Application Development and Automation 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: 
Read only

BDC

former_member530652
Participant
0 Likes
1,518

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

11 REPLIES 11
Read only

Former Member
0 Likes
1,477

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.

Read only

0 Likes
1,477

i made following change

perform bdc_field using 'BDC_OKCODE'

'=P+'.

but still it is not going to next page....

Read only

0 Likes
1,477

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

Read only

0 Likes
1,477

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

Read only

0 Likes
1,477

Let the okcode be '/00'.Just apply the which i told you.

Read only

0 Likes
1,477

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

Read only

0 Likes
1,477

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.

Read only

Former Member
0 Likes
1,477

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

Read only

Former Member
0 Likes
1,477

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********&

Read only

0 Likes
1,477

can u give me one sample example....

Read only

0 Likes
1,477

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.