04-23-2008 1:14 PM
Hi,
i need code for this....
 GPC Data (logic to get GPC code is as follows:)
Read AMPL with BMATN = material number and sy-datum GE datuv and sy-datum LE datub
If record found, set GPC Code = ampl-ematn
Else.
Select mara where bmatn = material number
If record found, set GPC code = MARA-MFRPN
Else GPC code is blank.
please help, points sure.
Anshuman
04-24-2008 5:30 AM
Hi Anshu,
I did not get what actually you are looking for but the simple
logic could be as below:
Select single * from AMPL into itab where BMATN = material number and sy-datum GE datuv and sy-datum LE datub.
If sy-subrc eq 0.
GPC Code = ampl-ematn
else.
Select mara where bmatn = material number.
if sy-subrc eq 0.
GPC code = MARA-MFRPN
else.
GPC code = ' '.
endif.
endif.
I hope I have tried to answer your question to the best of my ability.
Do let me know in case you have any further queries.
Regards,
Puneet Jhari.