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

KO03- system status

Former Member
0 Likes
3,337

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,295

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

4 REPLIES 4
Read only

Former Member
0 Likes
2,296

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

Read only

madan_ullasa
Contributor
0 Likes
2,295

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..

Read only

Former Member
0 Likes
2,295

check this standard report for KO03 SAPMKAUF. You can get tables and fields involved in it

Read only

Former Member
0 Likes
2,295

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.