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

doubt in bdc

Former Member
0 Likes
550

hi there,

1.how can we upload currency and quantity feilds in bdc. (recent question)

2. to handle table control is there any option in recarding(like any button..etc)?

(if plz explain me how to use it?)

3. can we schedule call transaction method for background?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
531

hi,

1.how can we upload currency and quantity feilds in bdc. (recent question)

<b>Ans:</b> *convert currency in to character field while declaring in internal table & change the flat file field to number/currency depending upon the requirement.

*same way convert quantity into char type in internal table & change the quantity field as "number" format in flat file.

2. to handle table control is there any option in recarding(like any button..etc)?

(if plz explain me how to use it?)

<b>Ans:</b> No.

3. can we schedule call transaction method for background?

<b>Ans:</b> yes it is possible.

reward points if useful.

regards,

kavitha.

hi there,

1.how can we upload currency and quantity feilds in bdc. (recent question)

2. to handle table control is there any option in recarding(like any button..etc)?

(if plz explain me how to use it?)

3. can we schedule call transaction method for background?

3 REPLIES 3
Read only

Former Member
0 Likes
531

1) Write the currency/amount field to a character field of the same size as on the screen.

2) Look for a 'position' option on the screen.

3) Yes

Rob

Read only

Former Member
0 Likes
531

1.how can we upload currency and quantity feilds in bdc. (recent question)

convert them into charcter field

2. to handle table control is there any option in recarding(like any button..etc)?

(if plz explain me how to use it?)

See the logic for table control

report zpochange.

data : i_error like bdcmsgcoll occurs 0 with header line.

data : i_bdcdata like bdcdata occurs 0 with header line.

tables : ekko, ekpo.

data :c1(10) value 'ME22',

c2(1) value ',',c3(10).

data : var1(20). " LIKE EKKO-EBELN.

data : var2 like ekko-ebeln.

data : begin of i_ekko occurs 0,

header(2),

ebeln like ekko-ebeln,

end of i_ekko.

data : begin of i_ekpo occurs 0,

item(2),

ebeln like ekpo-ebeln,

ebelp like ekpo-ebelp,

menge(10), " LIKE EKPO-MENGE,

end of i_ekpo.

data : v like ekpo-ebelp.

data: begin of itab occurs 0,

text(300),

end of itab.

parameters: p_file like ibipparms-path.

*PARAMETERS: PONUMBER LIKE EKPO-EBELN.

at selection-screen on value-request for p_file.

call function 'F4_FILENAME'

exporting

program_name = syst-cprog

dynpro_number = syst-dynnr

  • FIELD_NAME = ' '

importing

file_name = p_file

.

start-of-selection.

*SELECT EBELN FROM EKKO INTO TABLE I_EKKO WHERE EBELN = PONUMBER.

*

  • SELECT EBELN EBELP MENGE FROM EKPO INTO TABLE I_EKPO WHERE EBELN

*= PONUMBER.

*

perform get_data.

*LOOP AT ITAB.

  • WRITE 😕 ITAB.

  • ENDLOOP.

loop at itab.

var1 = itab-text+0(1).

if var1 = 'H'.

*I_EKKO-EBELN = ITAB-TEXT.

split itab at c2 into i_ekko-header

i_ekko-ebeln.

  • SPLIT ITAB AT ',' INTO I_EKKO-EBELN.

    • " I_EKPO-EBELP

    • " I_EKPO-MENGE

    • " var1.

append i_ekko.

else.

split itab at c2 into i_ekpo-item

i_ekpo-ebeln

i_ekpo-ebelp

i_ekpo-menge.

append i_ekpo.

endif.

*var2 = i_ekpo-ebeln.

  • MOVE VAR1 TO I_EKPO-EBELN.

  • MOVE VAR1 TO I_EKKO-EBELN.

  • APPEND: I_EKPO.

*if not var1 is initial.

  • split var1 at ',' into i_ekpo-ebelp

  • i_ekpo-menge.

  • i_ekpo-ebeln = var2.

  • append i_ekpo.

*endif.

endloop.

loop at i_ekpo.

write 😕 i_ekpo.

endloop.

*

loop at i_ekko.

perform fill_data. " TABLES I_EKPO.

endloop.

  • LOOP AT I_EKPO.

  • WRITE 😕 I_EKPO.

  • ENDLOOP.

*&----


*& Form GET_DATA

*&----


  • text

*----


  • --> p1 text

  • <-- p2 text

*----


*LOOP AT I_ERROR.

  • WRITE 😕 I_ERROR.

  • ENDLOOP.

*

form get_data.

call function 'WS_UPLOAD'

exporting

codepage = ' '

filename = p_file

filetype = 'ASC'

headlen = ' '

line_exit = ' '

trunclen = ' '

user_form = ' '

user_prog = ' '

dat_d_format = ' '

  • IMPORTING

  • FILELENGTH =

tables

data_tab = itab

exceptions

conversion_error = 1

file_open_error = 2

file_read_error = 3

invalid_type = 4

no_batch = 5

unknown_error = 6

invalid_table_width = 7

gui_refuse_filetransfer = 8

customer_error = 9

others = 10

.

if sy-subrc <> 0.

message id sy-msgid type sy-msgty number sy-msgno

with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

endif.

endform. " GET_DATA

*&----


*& Form FILL_DATA

*&----


  • text

*----


  • -->P_I_EKPO text

*----


form fill_data. " tables i_ekpo .

perform bdcscreen using 'SAPMM06E' '0105'.

perform bdcfield using 'RM06E-BSTNR' i_ekko-ebeln.

perform bdcfield using 'BDC_OKCODE' '/00'.

loop at i_ekpo where ebeln = i_ekko-ebeln.

  • V = I_EKPO-EBELP.

perform bdcscreen using 'SAPMM06E' 0120.

perform bdcfield using 'BDC_CURSOR' 'RM06E-EBELP'.

perform bdcfield using 'RM06E-EBELP' i_ekpo-ebelp.

perform bdcfield using 'BDC_OKCODE' '/00'.

perform bdcscreen using 'SAPMM06E' 0120.

perform bdcfield using 'BDC_CURSOR' 'EKPO-MENGE(01)'.

perform bdcfield using 'RM06E-EBELP' i_ekpo-ebelp.

perform bdcfield using 'EKPO-MENGE(01)' i_ekpo-menge.

perform bdcfield using 'BDC_OKCODE' '/00'.

*PERFORM BDCSCREEN USING 'SAPMM06E' 0120.

*

*PERFORM BDCFIELD USING 'BDC_CURSOR' 'RMO6E-EBELP'.

*

*CLEAR V.

endloop.

perform bdcfield using 'BDC_OKCODE' '=BU'.

call transaction c1 using i_bdcdata mode 'A'

messages into i_error.

refresh i_bdcdata.

endform. " FILL_DATA

*&----


*& Form BDCSCREEN

*&----


  • text

*----


  • -->P_0140 text

  • -->P_0120 text

*----


form bdcscreen using p_program p_screen.

i_bdcdata-program = p_program.

i_bdcdata-dynpro = p_screen.

i_bdcdata-dynbegin = 'X'.

append i_bdcdata.

clear i_bdcdata.

endform. " BDCSCREEN

*&----


*& Form BDCFIELD

*&----


  • text

*----


  • -->P_0145 text

  • -->P_I_EKPO_EBELN text

*----


form bdcfield using fnam fval.

i_bdcdata-fnam = fnam.

i_bdcdata-fval = fval.

append i_bdcdata.

clear i_bdcdata.

endform. " BDCFIELD

3. can we schedule call transaction method for background?

Yes

Reward Points if it is helpful

Thanks

Seshu

Read only

Former Member
0 Likes
532

hi,

1.how can we upload currency and quantity feilds in bdc. (recent question)

<b>Ans:</b> *convert currency in to character field while declaring in internal table & change the flat file field to number/currency depending upon the requirement.

*same way convert quantity into char type in internal table & change the quantity field as "number" format in flat file.

2. to handle table control is there any option in recarding(like any button..etc)?

(if plz explain me how to use it?)

<b>Ans:</b> No.

3. can we schedule call transaction method for background?

<b>Ans:</b> yes it is possible.

reward points if useful.

regards,

kavitha.