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: 

BDC for ME11(Creating Purchase info records) using Material Group

former_member267445
Participant
0 Kudos

Hello Gurus,

I am new to BDC, I have created a recording for ME11 and written BDC program for Material Groups. Program is working fine for 1st record in flat file but if flat file contains multiple records system giving me an error "Info record already exist for plant" because ME11 holds previous record with info record number in initial screen. Am using CALL TRANSACTION method.

Please let me, how to handle this situation if flat file contains multiple records so that every record executes in ME11.

Thanks and Regards,

Muralikrishna Peravali

1 ACCEPTED SOLUTION

Chintu6august
Contributor
0 Kudos

Hi,

clear the parameter ID after your call transaction statement.

SET PARAMETER ID 'SOME_PID' FIELD space.

thanks!!

14 REPLIES 14

former_member226239
Contributor
0 Kudos

Murali,

It is very simple. You just loop the data. Say for example you have 10 records in the flat file, first get this data into internal table and do the following.

Loop at lt_data into ls_data.

"Populate the BDC structures/tables

"Call transaction

call transaction ME11 using lt_bdcdata

                                   mode 'N' update 'S'.

Endloop.

Don't forget to clear the variables in the loop.

-Chandra

former_member267445
Participant
0 Kudos

Hi Chandra,

Thankyou for your response. I have already done the code as you suggested and everything is fine but the issue is when ever we create info record manually for material group the values still hold in ME11 for next creation of info record so here after deleting the entries and entering the values manually then only system allows to create.

Coming to BDC program, after successful of 1st record we can not delete the values manually so that why am getting error. So, I need to handle without giving error and proceed to further.

Any suggestion.

Thanks and Regards,

Muralikrishna Peravali

Former Member
0 Kudos

Hi Murali,

You need to  refresh the bdc data internal table in each loop pass.below links may be helpful

BDC recording for transaction 'ME11' by call tr... | SCN

0 Kudos

Hi Pallavi,

I have written refresh bdc in loop pass. I am thinking its not the problem in code, the previous values will be in ME11 transaction only. Even if we clear ME11 will not clear the values I guess.

Thanks and Regards,

Muralikrishna Peravali

0 Kudos

Hello

Please attach your sample code and clearly state which field value remains?

Nabheet

0 Kudos

Hello Nabheet,

Please find the code as attachment. The values of Vendor, Pur. Org., Plant and Info record still remains on screen of ME11, I think it is standard behavior.

Thanks and Regards,

Muralikrishna Peravali.

0 Kudos

Either set parameter id 'INF'  field blank

or add below mentioned line always before EINA-LIFNR line.

** Vendor

    PERFORM f_bdc_field  USING 'EINA-INFNR' ' '.

0 Kudos

Hello Nabheet,

Thank you for reply. If I want to clear the Vendor, Pur. Org., Plants also, do I need to use the same way which you suggested?

Thanks and Regards,

Muralikrishna

0 Kudos

yes

0 Kudos

Hello Nabheet,

Either set parameter ID or sending blank value to the screen... correct?

Thanks and Regards,

Muralikrishna Peravali

Chintu6august
Contributor
0 Kudos

Hi,

clear the parameter ID after your call transaction statement.

SET PARAMETER ID 'SOME_PID' FIELD space.

thanks!!

0 Kudos

Hello Chintu,

Thank you for reply. I will try this suggestion. Will this work for my requirement?

Thanks and Regards,

Muralikrishna Peravali.

0 Kudos

yes it will work for sure.. as each iteration of the loop the ME11 screen fields will come blank.

click F1 on the fields and get their parameter ID's and set them to blank.

SET PARAMETER ID ' LIF'    FIELD space.

SET PARAMETER ID ' MAT'  FIELD space.

SET PARAMETER ID ' EKO'  FIELD space.

SET PARAMETER ID ' WRK' FIELD space.

SET PARAMETER ID ' INF'    FIELD space.

thanks!!

0 Kudos

Hello Chintu,

Apologies for the late reply as I was busy. Yes it worked fine for me. Thanks a lot.

Thanks and Regards,

Muralikrishna Peravali.