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: 

problem in passing data from customized program to SAP standard transaction

Former Member
0 Kudos

Hello Abapers ,

I have problem related to the above subject . I have a requirement, in which I have to pass the material , plant and batch in the fields of Tcode 'MSC1N' and skip the first screen so that the user cannot change these values after enter in the transaction .

So I have made an customized program from where I am passing these values to the tcode 'MSC1N' by a partial BDC program and after that I am calling the Tcode 'MSC1N' by call transaction method . this part of the program is given below :

perform bdc_dynpro using 'SAPLCHRG' '1000'.

perform bdc_field using 'BDC_OKCODE'

'=CLAS'.

perform bdc_field using 'BDC_CURSOR'

'DFBATCH-CHARG'.

perform bdc_field using 'DFBATCH-MATNR'

'PI101'.

perform bdc_field using 'DFBATCH-WERKS'

'1000'.

perform bdc_field using 'DFBATCH-CHARG'

'AC27253'.

perform bdc_dynpro using 'SAPLCHRG' '1000'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

CALL TRANSACTION 'MSC1N' USING ZBDCDATA MODE 'E'.

With this code, the values are passed in the transaction and batch is also created . But when I put the characteristic values of a batch and try to save ,it fails . Because when I go to 'MSC3N' , it's seen that only the batch is created but the characteristic values are not maintained there . So, please tell me what's the problem happend . Why the characteristic values are not saved after clicking onthe save button ? Thank's in advance .

4 REPLIES 4

anjaneya_bhardwaj2
Contributor
0 Kudos

Hello,

did you create the classification without this how are you expecting the chacateristic value .

Remeber batch creation + characteristic assignment should happen your program handles just batch creation and that is why you are not getting characteristic values .

Why don't use the BAPI avialable for this instaed of BDC that will be the ideal way .

BAPI For batch creation ''BAPI_BATCH_CREATE'' and for creation of characteristics 'BAPI_OBJCL_CHANGE' .

Go through the documenation of the above BAPI and you will know how to use it So your custom program should be to have the input file-> create batch then ->create classification ....

In case you need halp calling these BAPI's revert back ...But i think it should be staright forward .....

Thanks,

Anjaneya .

Edited by: Anjaneya Bhardwaj on Aug 26, 2011 6:49 AM

0 Kudos

Anjaneya ,

Thanks for your reply . According to your reply I am able to create batch by 'BAPI_BATCH_CREATE' . But can't create the characteristic with 'BAPI_OBJCL_CHANGE' and I need these characteristic under the classification tab of 'MSC!N' or 'MSC3N' . So plese help me , how to use 'BAPI_OBJCL_CHANGE' with some example ?

0 Kudos

Hi can you do a google/where used list on this BAPI ...

I am sure there are many examples already available for this .

One at below link .

[;

Solve the problem and let us know .

Thanks,

Anjaneya .

former_member222709
Contributor
0 Kudos

Hi,

I would recommend the suggestions given by Anjaneya.

But, still if you want to find the reason to your problem, I suppose, in the BDC recording you need to check the values passed at the 'SAVE' command.

What happens is, you might have to pass the characteristic values again to the screen at the time of 'SAVE' command. If those values/codes were part of the recording and you might have deleted them for redundancy, then please check again.

Regards,

Pranav.