02-08-2016 4:31 PM
HI,
I need a small clarification
Below is my Structure i was Declared.
TYPES: BEGIN OF TEMP_AFVC.
TYPES: BEARZ_PTIME TYPE P LENGTH 16 DECIMALS 3.
TYPES: BEAZE_PUNIT TYPE AFVV-BEAZE.
TYPES: BEARZ_PTIME_H TYPE P LENGTH 16 DECIMALS 3.
TYPES: BEAZE_PUNIT_H TYPE AFVV-BEAZE.
INCLUDE STRUCTURE AFVC.
TYPES: END OF TEMP_AFVC.
DATA:IT_TEMP_AFVC TYPE TABLE OF TEMP_AFVC,
WA_TEMP_AFVC TYPE TEMP_AFVC.
Now i would like to Fetch the data from the Data base to My internal table. query like below.
IF NOT SIT_AUFPL IS INITIAL.
SELECT * INTO CORRESPONDING FIELDS OF TABLE IT_TEMP_AFVC FROM AFVC. "
* FOR ALL ENTRIES IN SIT_AUFPL[]
* WHERE AUFPL EQ SIT_AUFPL-AUFPL.
ENDIF.
But no data is fetching , May i know why. Things i did.
1)Data is available. No doubt.
2)In debugging Query is running, means , cursor is moving into the if condition.
3)I changes Aufpl instead of * but no use.
Any information please Update me.
.
02-09-2016 5:57 AM
I've checked everything and run this on my own system without errors. It gets data.
This is my test code. The trick with writing test code is to remove all the complexities except your exact problem. In this case, the select seems not to be working - so remove the IF... ENDIF around it:
TYPES: BEGIN OF temp_afvc.
TYPES: bearz_ptime TYPE p LENGTH 16 DECIMALS 3.
TYPES: beaze_punit TYPE afvv-beaze.
TYPES: bearz_ptime_h TYPE p LENGTH 16 DECIMALS 3.
TYPES: beaze_punit_h TYPE afvv-beaze.
INCLUDE STRUCTURE afvc.
TYPES: END OF temp_afvc.
DATA:it_temp_afvc TYPE TABLE OF temp_afvc,
wa_temp_afvc TYPE temp_afvc.
SELECT * INTO CORRESPONDING FIELDS OF TABLE it_temp_afvc FROM afvc. "
LOOP AT it_temp_afvc INTO wa_temp_afvc.
WRITE / wa_temp_afvc-aufpl.
ENDLOOP.
Do the following.
1. Create a test program in your system with the above code and run it. Does it work?
2. If not please post a screen dump of SE16 on AFVC. Because the most likely cause of your problem is that, despite your statement to the contrary, there is no data in the table.
3. If you really have got data then you need to send your SAP system back to SAP because it's clearly broken.
02-08-2016 9:54 PM
How many records are there in AFVC?
Can you try up to 10 rows at the end of the select statement and see what is happening?
-Chandra
02-09-2016 3:11 AM
Hi, Thanks for your reply. No use. Still not appending to my internal table.
I have two structures. Both are behaving the Same.
Can any body please Tell me what is the mistake i Did it in the above Declaration. Never faced this type of problem.
IF NOT SIT_AUFPL IS INITIAL.
SELECT * UP TO 10 rows INTO CORRESPONDING FIELDS OF TABLE IT_TEMP_AFVC FROM AFVC. "
* FOR ALL ENTRIES IN SIT_AUFPL[]
* WHERE AUFPL EQ SIT_AUFPL-AUFPL.
ENDIF.
IF NOT SIT_AUFPL IS INITIAL.
SELECT * up to 10 rows INTO CORRESPONDING FIELDS OF TABLE IT_TEMP_FAFVV FROM AFVV .
" WHERE AUFPL = 0000000099.
* FOR ALL ENTRIES IN SIT_AUFPL[]
* WHERE AUFPL EQ SIT_AUFPL-AUFPL.
ENDIF.
02-09-2016 3:20 AM
02-09-2016 3:30 AM
02-09-2016 3:48 AM
02-09-2016 5:57 AM
I've checked everything and run this on my own system without errors. It gets data.
This is my test code. The trick with writing test code is to remove all the complexities except your exact problem. In this case, the select seems not to be working - so remove the IF... ENDIF around it:
TYPES: BEGIN OF temp_afvc.
TYPES: bearz_ptime TYPE p LENGTH 16 DECIMALS 3.
TYPES: beaze_punit TYPE afvv-beaze.
TYPES: bearz_ptime_h TYPE p LENGTH 16 DECIMALS 3.
TYPES: beaze_punit_h TYPE afvv-beaze.
INCLUDE STRUCTURE afvc.
TYPES: END OF temp_afvc.
DATA:it_temp_afvc TYPE TABLE OF temp_afvc,
wa_temp_afvc TYPE temp_afvc.
SELECT * INTO CORRESPONDING FIELDS OF TABLE it_temp_afvc FROM afvc. "
LOOP AT it_temp_afvc INTO wa_temp_afvc.
WRITE / wa_temp_afvc-aufpl.
ENDLOOP.
Do the following.
1. Create a test program in your system with the above code and run it. Does it work?
2. If not please post a screen dump of SE16 on AFVC. Because the most likely cause of your problem is that, despite your statement to the contrary, there is no data in the table.
3. If you really have got data then you need to send your SAP system back to SAP because it's clearly broken.
02-09-2016 6:06 AM
Hi,
Thanks for your reply. Yes, Checking. Some problem From my side.