Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Production order posting date issue

former_member381412
Participant
0 Kudos
337

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

10 REPLIES 10

JL23
Active Contributor
0 Kudos
239

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.

0 Kudos
239

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.

JL23
Active Contributor
0 Kudos
239

best you show screenshots from SE16N and your debugger so that we can compare

0 Kudos
239

Please find attached se16n screenshot

JL23
Active Contributor
0 Kudos
239

we still would need to the values from ITAB-MATNR, ITAB-CHARG, ITAB-KDAUF and ITAB-BUDAT before MODIFY ITAB

0 Kudos
239

Dear Jürgen,

Please find attached debugger screenshot

0 Kudos
239

Dear Can you correct my query ???

JL23
Active Contributor
0 Kudos
239

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.

raymond_giuseppi
Active Contributor
0 Kudos
239

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.

  • From where does your ITAB-BUDAT come from?

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'?

matt
Active Contributor
0 Kudos
239

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.