06-04-2009 10:31 AM
Hi all,
I need to provide a value to a mandatory field in BDC Recording. The screen which is carrying this field is being called by the OK-CODE "=BU" of the previous screen.
Now, I wrote in program, creating a new form calling the screen with mandatory field and apending the BDCDATA table as follows and placing the perform below to the prior screen's perform.
FORM SAPLM07M-0410.
CLEAR BDCDATA.
BDCDATA-PROGRAM = 'SAPMM07M'.
BDCDATA-DYNPRO = '0410'.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
Storage Type
CLEAR BDCDATA.
BDCDATA-FNAM = 'MSEG-LGTYP(1)'.
BDCDATA-FVAL = P_LGTYP.
APPEND BDCDATA.
Storage Bin
CLEAR BDCDATA.
BDCDATA-FNAM = 'MSEG-LGPLA'.
BDCDATA-FVAL = P_LGPBE.
APPEND BDCDATA.
CLEAR BDCDATA.
BDCDATA-FNAM = 'BDC_OKCODE'.
BDCDATA-FVAL = '=SICH'.
APPEND BDCDATA.
ENDFORM.
But still the fields are not getting appended. It seems, since this screen is not recorded, the data is not getting appended, but not sure.
Any pointers on this would be of great help.
Thanks in advance,
Vamsee.
06-04-2009 10:35 AM
Hi,
Instead of OK_CODE 'BU' try giving ok_Code as '=ENT' or the valid OK_CODE for enter on that particular screen and then call your screen 0140 and check.
Regards,
Ankur Parab
06-04-2009 10:41 AM
hi ,
Is passing values through parameters like "p_lgtyp" is correct method of passing??
regards,
Vamsee.
06-04-2009 10:48 AM
Hi VamseePriya,
What T-code You need to do recording, what is Mandotory Field.
please be more specific on your requirement.
Regards,
Suneel G
06-04-2009 10:48 AM
Hi,
Do you mean
BDCDATA-FVAL = P_LGTYP?
Yes you can directly assign the value of the parameter.
Regards,
Ankur Parab
06-04-2009 10:57 AM
Hi,
I'm doing for Transaction MB1C.
Recording takes from, from Header screen to Item screen.
Now, I need to enter the mandatory fields "storage bin' & 'storage type' in the item level screen.
OK-CODE "/BU" is taking me from Header level screen to Item level screen.
here, since I added the above mentioned code to insert these two mandatory fields.
Regards,
Vamsee.
06-04-2009 11:06 AM
Hi,
The OK_CODE 'BU' is generally associated with 'SAVE' and therefore your BDC migh be ending abruptly.
Please re-do your recording once again to check teh screen sequence.
Use BACK or ENTER button before SAVING and entering all the mandatory information to come back to the header screen.
Regards,
Ankur Parab
06-04-2009 11:29 AM
My Program is as follows :
PERFORM SAPLM07M-0400.
PERFORM SAPLM07M-0421.
PERFORM SAPLM07M-0410.
FORM SAPLM07M-0400.
*
CLEAR BDCDATA.
BDCDATA-PROGRAM = 'SAPMM07M'.
BDCDATA-DYNPRO = '0400'.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
*
CLEAR BDCDATA.
BDCDATA-FNAM = 'RM07M-BWARTWA'.
BDCDATA-FVAL = P_BWART.
APPEND BDCDATA.
Werk
CLEAR BDCDATA.
BDCDATA-FNAM = 'RM07M-WERKS'.
BDCDATA-FVAL = P_WERKS.
APPEND BDCDATA.
Lagerort
CLEAR BDCDATA.
BDCDATA-FNAM = 'RM07M-LGORT'.
BDCDATA-FVAL = P_LGORT.
APPEND BDCDATA.
Steuerkennzeichen für Kontierung
CLEAR BDCDATA.
BDCDATA-FNAM = 'XFULL'.
BDCDATA-FVAL = ' '.
APPEND BDCDATA.
CLEAR BDCDATA.
BDCDATA-FNAM = 'BDC_OKCODE'.
BDCDATA-FVAL = '/00'.
APPEND BDCDATA.
*
ENDFORM. "SAPLM07M-0400
FORM SAPLM07M-0421.
*
CLEAR BDCDATA.
BDCDATA-PROGRAM = 'SAPMM07M'.
BDCDATA-DYNPRO = '0421'.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
GL Account
CLEAR BDCDATA.
BDCDATA-FNAM = 'MSEGK-KONTO'.
BDCDATA-FVAL = C_GLACC.
APPEND BDCDATA.
Business Area
CLEAR BDCDATA.
BDCDATA-FNAM = 'COBL-GSBER'.
BDCDATA-FVAL = V_GSBER.
APPEND BDCDATA.
Profit Center
CLEAR BDCDATA.
BDCDATA-FNAM = 'COBL-PRCTR'.
BDCDATA-FVAL = V_PRCTR.
APPEND BDCDATA.
Identnummer
CLEAR BDCDATA.
BDCDATA-FNAM = 'MSEG-MATNR(1)'.
BDCDATA-FVAL = UP_TAB1_V-MATNR.
APPEND BDCDATA.
Erfassungsmenge
CLEAR BDCDATA.
BDCDATA-FNAM = 'MSEG-ERFMG(1)'.
DATA : N_MENGE(10) TYPE N.
MOVE UP_TAB1_V-MENGE TO N_MENGE.
BDCDATA-FVAL = N_MENGE.
APPEND BDCDATA.
**
CLEAR BDCDATA.
BDCDATA-FNAM = 'BDC_OKCODE'.
BDCDATA-FVAL = '=BU'.
BDCDATA-FVAL = '/00'.
APPEND BDCDATA.
Storage Type
CLEAR BDCDATA.
BDCDATA-FNAM = 'MSEG-LGTYP'.
BDCDATA-FVAL = P_LGTYP.
APPEND BDCDATA.
Storage Bin
CLEAR BDCDATA.
BDCDATA-FNAM = 'MSEG-LGPLA'.
BDCDATA-FVAL = P_LGPBE.
APPEND BDCDATA.
CLEAR BDCDATA.
BDCDATA-FNAM = 'BDC_OKCODE'.
BDCDATA-FVAL = '/00'.
APPEND BDCDATA.
ENDFORM. "SAPLM07M-0421
FORM SAPLM07M-0410.
CLEAR BDCDATA.
BDCDATA-PROGRAM = 'SAPMM07M'.
BDCDATA-DYNPRO = '0410'.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
Storage Type
CLEAR BDCDATA.
BDCDATA-FNAM = 'MSEG-LGTYP'.
v_lgtyp = p_lgtyp.
BDCDATA-FVAL = v_LGTYP.
APPEND BDCDATA.
Storage Bin
CLEAR BDCDATA.
BDCDATA-FNAM = 'MSEG-LGPLA'.
v_lgpbe = p_lgpbe.
BDCDATA-FVAL = v_LGPBE.
APPEND BDCDATA.
CLEAR BDCDATA.
BDCDATA-FNAM = 'BDC_OKCODE'.
BDCDATA-FVAL = '=SICH'.
APPEND BDCDATA.
ENDFORM.
Our input file structure is as follows:
DATA : BEGIN OF UP_TAB1 OCCURS 500,
FELD_01(20),
FILL_01(1) TYPE C,
FELD_02(20),
FILL_02(1) TYPE C,
FELD_03(20),
FILL_03(1) TYPE C,
FELD_04(20),
FILL_04(1) TYPE C,
FELD_05(20),
FILL_05(1) TYPE C,
FELD_06(20),
FILL_06(1) TYPE C,
FELD_07(20), "ID-code
FILL_07(1) TYPE C,
FELD_08(20),
FILL_08(1) TYPE C,
FELD_09(20), "QTY
FILL_09(1) TYPE C,
FELD_10(20),
FILL_10(1) TYPE C,
FELD_11(20),
FILL_11(1) TYPE C,
FELD_12(20),
FILL_12(1) TYPE C,
FELD_13(20),
FILL_13(1) TYPE C,
FELD_14(20),
FILL_14(1) TYPE C,
FELD_15(20),
FILL_15(1) TYPE C,
FELD_16(20),
FILL_16(1) TYPE C,
END OF UP_TAB1.
but presently the fields that I'm entering are not part of this structure.
I'm trying to insert the parameters on the selection sceen directly.
06-04-2009 10:56 AM
I guess, u are calling the screen twice...
No need to call it again...u are already getting the required screen with OK-CODE "=BU"...
Try like this....
Storage Type
CLEAR BDCDATA.
BDCDATA-FNAM = 'MSEG-LGTYP(1)'.
BDCDATA-FVAL = P_LGTYP.
APPEND BDCDATA.
Storage Bin
CLEAR BDCDATA.
BDCDATA-FNAM = 'MSEG-LGPLA'.
BDCDATA-FVAL = P_LGPBE.
APPEND BDCDATA.
CLEAR BDCDATA.
BDCDATA-FNAM = 'BDC_OKCODE'.
BDCDATA-FVAL = '=SICH'.
APPEND BDCDATA.
Give ur perform1 code...
06-04-2009 11:19 AM
Hi,
In my recording I found the screen is
perform bdc_dynpro using 'SAPMM07M' '0421'.
perform bdc_field using 'BDC_CURSOR'
'MSEG-LGORT(01)'.
perform bdc_field using 'MSEG-LGORT(01)'
wa_upload-lgort.
How do u upload the data and wht is structure of your Flat File
Regards,
Suneel G
06-04-2009 12:08 PM
A better option is to record the process, and use the same code, so that you are not missing any code.
Also, put a break point inside this perform, and see,wheather appending is done or not, and if done, where the data is getting wiped of .
06-04-2009 12:42 PM
I placed a break point at the BDC_INSERT.
I could see my data in the BDCDATA.
but,I wonder why the data is not getting updated.
06-04-2009 12:51 PM
as I have suggested above, Record the process again and try the generated code .
May be you are missing some code .