2018 Jul 23 10:24 AM
Dear All,
we want to try to insert production posting date in our z report but production order posting date not coming please check our query and give me idea how to fetch production order posting date
LOOP AT ITAB.
SELECT SINGLE AUFNR FROM AUFM INTO ITAB-AUFNR
WHERE MATNR = ITAB-MATNR
AND SOBKZ = 'E'
AND BWART = '101'
AND SHKZG = 'S'
AND ELIKZ = 'X'.
AND CHARG = ITAB-CHARG
AND KDAUF = ITAB-KDAUF.
AND BUDAT = ITAB-BUDAT.
MODIFY ITAB.
ENDLOOP.
Thanks in Advance
2018 Jul 23 10:30 AM
I would use SE16N to display the record that you want from AUFM table and compare it with the values of your selection parameters in the debugger.
2018 Jul 23 10:34 AM
Dear Jurgen,
I have checked se16n . as per need all date are showing in AUFM table but as per our query posting date not coming.
in debugger. production order number and material number is coming.
2018 Jul 23 10:45 AM
best you show screenshots from SE16N and your debugger so that we can compare
2018 Jul 23 10:52 AM
2018 Jul 23 11:00 AM
we still would need to the values from ITAB-MATNR, ITAB-CHARG, ITAB-KDAUF and ITAB-BUDAT before MODIFY ITAB
2018 Jul 23 11:04 AM
2018 Jul 23 11:25 AM
2018 Jul 23 11:54 AM
How do you expect to get the document from AUFM which has a posting date of 18.07.2018 if you do a select with posting date 000000?
how do you expect to get this document which has a sales order 0018200040 if you do the select with blank?
without really knowing what the purpose of this is and why you have not the right values it is hard to make it correct.
The select parameters actually changed between what you posted in your question and what you just showed in your coding. In your question you select with ITAB fields in your coding you have now WA_fields. Still it is not known why they are initial.
2018 Jul 23 10:32 AM
How did you build the original internal table, did you check in your test database if there are actually records to read with those key values.
NB: Also try to rewrote your code, performance should be bad (select single in a loop, even a poor FOR ALL ENTRIES would be better, of course you should be able to execute this selection before this code, within the original selection/generation of 'ITAB'?
2018 Jul 23 10:38 AM
Tables with header lines are obsolete, select singles within a loop are a performance killer. Finally, without knowing what's in your database and what's in ITAB (a terrible name for an internal table), it's not possible to tell you what's wrong.