01-20-2016 6:37 PM
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
01-21-2016 5:21 AM
Hi,
clear the parameter ID after your call transaction statement.
SET PARAMETER ID 'SOME_PID' FIELD space.
thanks!!
01-20-2016 9:06 PM
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
01-21-2016 2:51 AM
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
01-21-2016 3:33 AM
Hi Murali,
You need to refresh the bdc data internal table in each loop pass.below links may be helpful
01-21-2016 3:42 AM
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
01-21-2016 4:55 AM
Hello
Please attach your sample code and clearly state which field value remains?
Nabheet
01-21-2016 7:52 AM
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.
01-21-2016 8:00 AM
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' ' '.
01-21-2016 8:12 AM
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
01-21-2016 8:17 AM
01-21-2016 8:25 AM
Hello Nabheet,
Either set parameter ID or sending blank value to the screen... correct?
Thanks and Regards,
Muralikrishna Peravali
01-21-2016 5:21 AM
Hi,
clear the parameter ID after your call transaction statement.
SET PARAMETER ID 'SOME_PID' FIELD space.
thanks!!
01-21-2016 7:54 AM
Hello Chintu,
Thank you for reply. I will try this suggestion. Will this work for my requirement?
Thanks and Regards,
Muralikrishna Peravali.
01-21-2016 8:42 AM
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!!
01-25-2016 2:05 PM
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.