2008 Oct 13 3:59 AM
Hi Experts
My report extracting all data in to text file and output to ALV. Internal order number is in Selection screen(Range).
My requirement is,
1) If Order number is in selection screen, check the
system status filel in KO03 t.code.
2) if System status is TECO do not extract the data for this order.
3)Display the message the message(Order is already closed) in selection screen.
4) System status is not equal to TECO, extract data
Pls help me
2008 Oct 13 4:10 AM
Hi Kumar,
Below is the Logic to fetch the data regarding the status TECO.
Use the order number(AUFNR) and go to Table AUFK. Pass AUFNR and get the Object NUmber (OBJNR).
Now use that OBJNR and pass it inthe table JEST and check if JEST-STAT = 'I0045' and INACT <> 'X'. That means it is TECO.
Thanks,
Chidanand
Hi Experts
My report extracting all data in to text file and output to ALV. Internal order number is in Selection screen(Range).
My requirement is,
1) If Order number is in selection screen, check the
system status filel in KO03 t.code.
2) if System status is TECO do not extract the data for this order.
3)Display the message the message(Order is already closed) in selection screen.
4) System status is not equal to TECO, extract data
Pls help me
2008 Oct 13 4:10 AM
Hi Kumar,
Below is the Logic to fetch the data regarding the status TECO.
Use the order number(AUFNR) and go to Table AUFK. Pass AUFNR and get the Object NUmber (OBJNR).
Now use that OBJNR and pass it inthe table JEST and check if JEST-STAT = 'I0045' and INACT <> 'X'. That means it is TECO.
Thanks,
Chidanand
2008 Oct 13 4:12 AM
Hi,
Check the relevant table for the value of the system status.... If that value is 'TECO', whatever values you are supposed to extract, dont do that...
Then display a message of type 'I' that the order is closed.. and exit from the program... you can also display a message of type 'E' , which will exist from further processing by itsel..
You would have to find all the relevant tables for this Tcode...
regards,
Madan..
2008 Oct 13 4:13 AM
check this standard report for KO03 SAPMKAUF. You can get tables and fields involved in it
2008 Oct 13 4:16 AM
Hi Kumar,
follow the steps.
1. Retrieve OBJNR of the document number from VBAP into I_VBAP table selecting vbeln posnr objnr fields
2. LOOP AT i_vbap INTO wa_vbap and call the FM 'STATUS_READ' and get stsma = v_qstsma TABLES status = i_qstatus
passing objnr = wa_vbap-objnr
Now select istat txt04 txt30 FROM tj02t INTO TABLE i_tj02t
FOR ALL ENTRIES IN i_qstatus
WHERE istat EQ i_qstatus-stat
AND spras = sy-langu.
Allot points if this is usefull.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |