Application Development and Automation 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: 
Read only

Production order posting date issue

former_member381412
Participant
0 Kudos
1,000

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
Read only

JL23
Active Contributor
0 Kudos
902

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.

Read only

0 Kudos
902

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.

Read only

JL23
Active Contributor
0 Kudos
902

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

Read only

0 Kudos
902

Please find attached se16n screenshot

Read only

JL23
Active Contributor
0 Kudos
902

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

Read only

0 Kudos
902

Dear Jürgen,

Please find attached debugger screenshot

Read only

0 Kudos
902

Dear Can you correct my query ???

Read only

JL23
Active Contributor
0 Kudos
902

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.

Read only

RaymondGiuseppi
Active Contributor
0 Kudos
902

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

Read only

matt
Active Contributor
0 Kudos
902

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.