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: 

LSMW for a single transaction with different screen sequence

Former Member
0 Kudos
843

Dear All,

I am doing a data upload for transaction QS21. The transaction calls screens in different sequence based on conditions.

For eg : in one condition it calls screens

like 100,101,108,110,101 like that.

when it is called with another condition it calls screens in sequence like 100, 101,110,101.

It skips certain screens in second sequence.

Is it possible in LSMW with one single object and single recording to acheive the above two scenarios or we have to go for separate objects.

Thanks,

regards

B.Ram

1 ACCEPTED SOLUTION

Former Member
0 Kudos
145

Hi Abhiram,

It is possible provided you know the conditions and have the data in your program to put these checks.

You BDCDATA table should be populated based on conditions -

If <CONDITION1> -

Populate BDCDATA with screens 100,101,108,110

ELSEIF CONDITON2

Populate BDCDATA with screens 100,101,110,101

ENDIF.

( Record once for both the flows and then try to merge your code as above ).

Cheers.

4 REPLIES 4

Former Member
0 Kudos
146

Hi Abhiram,

It is possible provided you know the conditions and have the data in your program to put these checks.

You BDCDATA table should be populated based on conditions -

If <CONDITION1> -

Populate BDCDATA with screens 100,101,108,110

ELSEIF CONDITON2

Populate BDCDATA with screens 100,101,110,101

ENDIF.

( Record once for both the flows and then try to merge your code as above ).

Cheers.

Former Member
0 Kudos
145

Hello all,

Thank u Sanjay for your idea.

I have done two different recording for different conditions, but please tell me how to merge it.

i tried put coding in LSMW...

begin of transaction/ begin of record/ begin of processing

..still not acheived.

could u give me an example for this.

Im trying to do LSMW for transaction: QS21.

In this transaction: depending on 'KONSISTENT' value

screens also differ.

Regards,

Thanks,

Pavitha

Former Member
0 Kudos
145

Lets say the Okcode for screen 100, 101, 102, 103

is 'OK1', 'OK2', 'OK3', 'OK4' with corresponding program name.

suppose sequence for conditon1 is 100, 101, 102.

and for condition2 is 100, 102, 103.

You can -

If < COndition1 >.

Populate BDCdata with respect to program name and

screen number 100.

Populate OK_CODE 'OK1' for that corresponding screen.

Similarly for 101, 102.

else < condition2>.

Populate OK_CODE 'OK1' for that corresponding screen.

Similarly for 102, 103.

end.

Former Member
0 Kudos
145

Hello sanjay & sharath,

Thanks, problem is solved.

I used batch input recording, did recording twice with different conditions, then in lsmw step 4, i assinged both

recording the same structure and in step 5 : for

begin of record.. i add code

if YQMIC1-KONSISTENT = ' '.

skip_record.

else.

LWMICOMIC4 = INIT_LWMICOMIC4.

endif.

like above for both recorded structure...

so it works fine

Thanks again,

Regards,

B.ram