2008 Jun 19 7:33 AM
I did a recording and put it in the program...i m uploading data from text file..it is having 15 fields but when i start uploading the data screen shows only 12 entries...when i press enter remaining 3 entries are being overwritten on the first 3 places...
can anyone give me the specification for page down concept
Hi Sandeep,
While recording (SHDB) use Page down Button on the Key board to scroll the table or page down, then check the Function code (BDC_OKCODE) in the program (code).
Best regards,
raam
2008 Jun 19 7:37 AM
Hi,
I faced the same issue.What i would suggest is after you have filled those 12 entries press 'ENTER' in recording.Capture that ok-code.Put a counter.The condition should be if ctr exceeds 12,'ENTER' ok code should called and reset the counter.Do this in a loop.
2008 Jun 19 8:02 AM
i made following change
perform bdc_field using 'BDC_OKCODE'
'=P+'.
but still it is not going to next page....
2008 Jun 19 8:04 AM
Hi Sandeep,
While recording (SHDB) use Page down Button on the Key board to scroll the table or page down, then check the Function code (BDC_OKCODE) in the program (code).
Best regards,
raam
2008 Jun 19 8:08 AM
yeah i used scroll down button then i got following fun. code
perform bdc_field using 'BDC_OKCODE'
'/00'.
but while uploading data it don't goto next page
so i changed fun code from /00 to =+p
but it is not changed
so can u tell me what i need to do
2008 Jun 19 8:10 AM
2008 Jun 19 8:15 AM
Hi Sandeep,
Can u please tell me the Transaction which u r recording?
Best regards,
raam
Edited by: Kodandarami Reddy.S on Jun 19, 2008 2:26 PM
2008 Jun 19 8:17 AM
Hi.
My suggestion is do recording again, while entering fields press pagedown button reather than scrolling. If u presss pagedown button that will also be recorded into ur recording and then enter ur remaing fields.
Now use that recording in ur program i think u wont face any problem, plz reward points if helpful.
Regards.
2008 Jun 19 7:38 AM
Hi,
In which transaction ur uploading data,
Ok, u just goto that transaction and check for the function code for the button next page (take the position on to that button by pressing tab button on keyborad) then u will get function code , so that now in ur program u can use this function code and u can move to next page,.
Regds,
Murali
2008 Jun 19 8:13 AM
Hi Sandeep ,
Put the Ok-code = '=P+'.
Also make sure you pass this line before executing the BDC
CTU_PARAMS-DEFSIZE = 'X'.
Other wise the if any user does have different resolution then the bdc will not work properly... I have also faced the same problem
&*********Reward Point if helpful********&
2008 Jun 19 9:21 AM
2008 Jun 19 9:24 AM
Hi,
The program below is to update characteristic values in MM02 transaction.:
Here p is a counter.
LOOP AT it_file INTO wa_file.
mytabix = mytabix + 1.
p = p + 1.
IF wa_file-matnr IS NOT INITIAL.
IF flag1 = '1'.
PERFORM bdc_dynpro USING 'SAPLCEI0' '0109'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BACK'.
*Save the data
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BU'.
*After filling BDC table call the transaction
CALL TRANSACTION 'MM02'
USING it_bdcdata
OPTIONS FROM x_ctuprms
MESSAGES INTO it_msgtab.
REFRESH it_bdcdata.
CLEAR it_bdcdata.
*Subroutine for collecting messages from transaction
PERFORM collect_messages.
ENDIF.
flag = '0'.
matnr = wa_file-matnr.
werks = wa_file-werks.
p = 1.
*Fetch the data from MARC for the entered material number and plant
SELECT SINGLE * FROM marc INTO wa_marc
WHERE matnr = wa_file-matnr
AND werks = wa_file-werks.
IF sy-subrc <> 0.
flag = '1'.
wa_messages-msgtyp = 'E'.
wa_messages-matnr = wa_file-matnr.
wa_messages-werks = wa_file-werks.
wa_messages-message = text-005.
APPEND wa_messages TO it_messages.
CLEAR wa_messages.
ELSE.
*Check if the configurable material is present in the plant
SELECT SINGLE * FROM marc INTO wa_marc1
WHERE matnr = wa_file-stdpd
AND werks = wa_file-werks.
IF sy-subrc <> 0.
flag = '1'.
wa_messages-msgtyp = 'E'.
wa_messages-matnr = wa_file-stdpd.
wa_messages-werks = wa_file-werks.
wa_messages-message = text-006.
APPEND wa_messages TO it_messages.
CLEAR wa_messages.
ELSE.
*Fetch the data from MARA for the entered material number
SELECT SINGLE * FROM mara INTO wa_mara
WHERE matnr = wa_file-matnr.
IF sy-subrc <> 0.
flag = '1'.
ELSE.
*Fetch the data from MARA for the entered material number
SELECT SINGLE * FROM makt INTO wa_makt
WHERE matnr = wa_file-matnr. "#EC *
IF sy-subrc <> 0.
flag = '1'.
ELSE.
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
input = wa_file-matnr
IMPORTING
output = wa_file-matnr
EXCEPTIONS
length_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
*Fill BDC table
PERFORM bdc_dynpro USING 'SAPLMGMM' '0060'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=AUSW'.
PERFORM bdc_field USING 'RMMG1-MATNR'
wa_file-matnr.
*Function to get the views for the material and
*pick MRP3 view
CALL FUNCTION 'MATERIAL_BTCI_SELECTION_NEW'
EXPORTING
material = wa_mara-matnr "Material to which char.values are attached
materialart = wa_mara-mtart "Material type
selection = 'D' "Indicator for MRP3 view
tcode = 'MM02' "Transaction code
TABLES
btci_d0070 = it_bdcdata1 "Internal table from which position of MRP3 view can be found out
EXCEPTIONS
material_not_found = 1
material_number_missing = 2
material_type_missing = 3
material_type_not_found = 4
no_active_dynpro_selected = 5
no_authority = 6
OTHERS = 7.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
*Select MRP3 view only
PERFORM bdc_dynpro USING 'SAPLMGMM' '0070'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
*Select the records for MRP view only
LOOP AT it_bdcdata1 INTO wa_bdcdata1 WHERE fval = 'X'.
*Take the position no.of MRP3 view
var_view = wa_bdcdata1-fnam+17(2).
sel_view = var_view.
CONDENSE sel_view NO-GAPS.
ctr = ctr + 1.
IF ctr EQ 3.
CONCATENATE 'MSICHTAUSW-KZSEL(0' sel_view ')' INTO view.
PERFORM bdc_field USING view 'X'.
CLEAR ctr.
EXIT.
ENDIF.
CLEAR view.
CLEAR wa_bdcdata1.
ENDLOOP.
*Selected plant
PERFORM bdc_dynpro USING 'SAPLMGMM' '0080'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMMG1-WERKS'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_field USING 'RMMG1-WERKS'
wa_file-werks.
*Selected MRP 3 tab
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=PB19'.
PERFORM bdc_field USING 'MAKT-MAKTX'
wa_makt-maktx.
PERFORM bdc_field USING 'MARC-PERKZ'
wa_marc-perkz.
PERFORM bdc_field USING 'MARC-STRGR'
wa_marc-strgr.
PERFORM bdc_field USING 'MARC-MTVFP'
wa_marc-mtvfp.
IF wa_marc-stdpd IS INITIAL.
PERFORM bdc_field USING 'MARC-STDPD'
wa_file-stdpd.
ENDIF.
*Pressed button 'Configure Variant'
PERFORM bdc_dynpro USING 'SAPLCEI0' '0109'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
n = p.
CONDENSE n NO-GAPS.
IF p LE 9.
CONCATENATE 'RCTMS-MNAME(0' n ')' INTO tran.
CONDENSE tran NO-GAPS.
ELSE.
CONCATENATE 'RCTMS-MNAME(' n ')' INTO tran.
CONDENSE tran NO-GAPS.
ENDIF.
PERFORM bdc_field USING tran wa_file-atwtb.
CLEAR tran.
IF p LE 9.
CONCATENATE 'RCTMS-MWERT(0' n ')' INTO tran.
ELSE.
CONCATENATE 'RCTMS-MWERT(' n ')' INTO tran.
ENDIF.
CONDENSE tran NO-GAPS.
PERFORM bdc_field USING tran wa_file-atwrt.
CLEAR tran.
flag1 = '1'.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ELSE .
IF flag = '0'.
IF p > 10.
p = 1.
PERFORM bdc_dynpro USING 'SAPLCEI0' '0109'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
ENDIF.
n = p.
CONDENSE n NO-GAPS.
IF p LE 9.
CONCATENATE 'RCTMS-MNAME(0' n ')' INTO tran.
ELSE.
CONCATENATE 'RCTMS-MNAME(' n ')' INTO tran.
CONDENSE tran NO-GAPS.
ENDIF.
PERFORM bdc_field USING tran wa_file-atwtb.
CLEAR tran.
IF p LE 9.
CONCATENATE 'RCTMS-MWERT(0' n ')' INTO tran.
ELSE.
CONCATENATE 'RCTMS-MWERT(' n ')' INTO tran.
ENDIF.
CONDENSE tran NO-GAPS.
PERFORM bdc_field USING tran wa_file-atwrt.
CLEAR tran.
READ TABLE it_file INTO wa_file1 INDEX mytabix.
IF wa_file1-matnr IS NOT INITIAL.
PERFORM bdc_dynpro USING 'SAPLCEI0' '0109'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BACK'.
*Save the data
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BU'.
flag1 = '0'.
*After filling BDC table call the transaction
CALL TRANSACTION 'MM02'
USING it_bdcdata
OPTIONS FROM x_ctuprms
MESSAGES INTO it_msgtab.
REFRESH it_bdcdata.
CLEAR it_bdcdata.
*Subroutine for collecting messages from transaction
PERFORM collect_messages.
CLEAR wa_file.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
IF flag = '0'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BACK'.
*Save the data
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BU'.
flag1 = '0'.
CALL TRANSACTION 'MM02'
USING it_bdcdata
OPTIONS FROM x_ctuprms
MESSAGES INTO it_msgtab.
ENDIF.
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |