cancel
Showing results for 
Search instead for 
Did you mean: 

bdc recording for mm01

Former Member
0 Kudos

hi all,

this is an extract of materail master upload for mm01 when i execute this recording purchase order text view doesnot get populated with text. anybody can tell me whts wrong with this?????

perform bdc_field using 'MAKT-MAKTX'

'carr'.

perform bdc_dynpro using 'SAPLSTXX' '1100'.

perform bdc_field using 'BDC_CURSOR'

'RSTXT-TXLINE(05)'.

perform bdc_field using 'BDC_OKCODE'

'=TXVB'.

perform bdc_field using 'RSTXT-TXLINE(02)'

'qqqqqqqqqqqqqq ssssssssssssssssssssss'

& 'sssss.00000000000000jjjjjjjjjjjjoo'.

perform bdc_field using 'RSTXT-TXLINE(03)'

'wwwwwwwwwwwwwwwwwwwwwwwwwwwwwww jjjjjj'

& 'jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj'.

perform bdc_field using 'RSTXT-TXLINE(04)'

'kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk'

& 'kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk'.

perform bdc_field using 'RSTXT-TXLINE(05)'

'66666666666666666666666666666666666666'

& '6666666666666666666666666666666666'.

perform bdc_dynpro using 'SAPLSTXX' '1100'.

perform bdc_field using 'BDC_CURSOR'

'RSTXT-TXLINE(06)'.

perform bdc_field using 'BDC_OKCODE'

'=TXBA'.

perform bdc_dynpro using 'SAPLMGMM' '4040'.

perform bdc_field using 'BDC_OKCODE'

'=SP12'.

perform bdc_field using 'MAKT-MAKTX'

'carr'.

perform bdc_dynpro using 'SAPLMGMM' '4000'.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

You have to upload the Texts using the CREATE_TEXT fun module

see the sample program

REPORT zmm_longtext

NO STANDARD PAGE HEADING

LINE-SIZE 255.

  • Internal Table for Upload of Long Texts Data

DATA: BEGIN OF itab1 OCCURS 0,

matnr LIKE mara-matnr, " Material

text LIKE tline-tdline, " Long Text

END OF itab1.

  • Internal Table for Upload of Long Texts Data

DATA: BEGIN OF itab OCCURS 0,

matnr LIKE mara-matnr, " Material

text LIKE tline-tdline, " Long Text

END OF itab.

  • To create Long Text lines for CREATE_TEXT function module

DATA:BEGIN OF dt_lines OCCURS 0.

INCLUDE STRUCTURE tline. " Long Text

DATA:END OF dt_lines.

  • Variable declarations for CREATE_TEXT function module

DATA : dl_name TYPE thead-tdname, " Object Name

dl_lan TYPE thead-tdspras, " Language

gv_matnr TYPE matnr.

  • Constants

CONSTANTS:

  • Object ID for Long Text of Material Basic Data 1

c_best TYPE thead-tdid VALUE 'GRUN',

c_material TYPE thead-tdobject VALUE 'MATERIAL'. " Object

  • Parameters

PARAMETERS p_file LIKE rlgrap-filename.

  • At selection-screen on Value Request for file Name

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

  • Get the F4 Values for the File

CALL FUNCTION 'F4_FILENAME'

EXPORTING

program_name = syst-cprog

dynpro_number = syst-dynnr

IMPORTING

file_name = p_file.

  • Start Of Selection

START-OF-SELECTION.

*To Upload Flat file

CALL FUNCTION 'UPLOAD'

EXPORTING

filename = p_file

filetype = 'DAT'

TABLES

data_tab = itab1

EXCEPTIONS

conversion_error = 1

invalid_table_width = 2

invalid_type = 3

no_batch = 4

unknown_error = 5

gui_refuse_filetransfer = 6

OTHERS = 7.

SORT itab1 BY matnr.

LOOP AT itab1.

CLEAR gv_matnr.

SELECT SINGLE matnr INTO gv_matnr

FROM mara WHERE bismt = itab1-matnr.

IF itab1-text NE ' '.

itab-matnr = gv_matnr.

itab-text = itab1-text.

APPEND itab.

ENDIF.

CLEAR itab.

ENDLOOP.

DELETE itab WHERE matnr EQ ' '.

  • Upload the Texts

SORT itab BY matnr.

LOOP AT itab.

dt_lines-tdformat = 'ST'.

dt_lines-tdline = itab-text.

APPEND dt_lines.

dl_lan = sy-langu.

dl_name = itab-matnr.

  • Call the Function Module to Create Text

CALL FUNCTION 'CREATE_TEXT'

EXPORTING

fid = c_best

flanguage = dl_lan

fname = dl_name

fobject = c_material

save_direct = 'X'

fformat = '*'

TABLES

flines = dt_lines

EXCEPTIONS

no_init = 1

no_save = 2

OTHERS = 3.

IF sy-subrc <> 0.

WRITE:/ 'Long Text Creation failed for Material'(001),

itab-matnr.

ELSE.

WRITE:/ 'Long Text Created Successfully for Material'(002),

itab-matnr.

ENDIF.

AT END OF matnr.

REFRESH dt_lines.

ENDAT.

ENDLOOP.

Regards

Anji

Answers (1)

Answers (1)

former_member195698
Active Contributor
0 Kudos

Try running the BDC In foreground mode. Then you can see whether the data is getting filled properly in the Fields , Correct sequence of the screen is there and correct function code is called

Regards,

Abhishek