Application Development 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: 

BDC for long text in SE63

Former Member
0 Kudos

Hi All,

I m working on long text for Z message class manually copy paste as per below path

SE91 -> Input Message class & message No -> Select change mode-> select "long text" pushbutton -> in the next screen I shall update

U1 &CAUSE&

AS EN Language

U1 &SYSTEM_RESPONSE&

AS EN Language

U1 &WHAT_TO_DO&

AS EN Language

U1 &SYS_ADMIN&

AS EN Language

since there is a lot of Z message, decided to go for a BDC program to update the long text from a flat file,

BDC recording is as per the path above in SHDB, the problem is that if suppose need to insert more then single line like

U1 &CAUSE&

AS EN Language

AS EN Language

It should be able to update from flat file but each single line as shown above will accommodate 73 char, if need further long text, need to enter at the end of each line to get next line, then input English text

this way it is difficult to record in BDC becoz it is not known which message will have text more then 73 char.

Please let me know any possible solution.

BDC program is

TYPES:

BEGIN OF t_itab,

arbgb TYPE t100-arbgb, "Area

msgnr TYPE t100-msgnr, "Message No.

text1 TYPE t100-text, "Message text

text2 TYPE t100-text,

text3 TYPE t100-text,

text4 TYPE t100-text,

END OF t_itab.

DATA:

i_itab TYPE TABLE OF t_itab INITIAL SIZE 0.

*Internal table declaration to store BDC data

DATA: BEGIN OF bdcdata OCCURS 0.

INCLUDE STRUCTURE bdcdata.

DATA: END OF bdcdata.

DATA:

k_itab TYPE t_itab.

DATA:

v_file TYPE string.

CONSTANTS:

c_mode TYPE c VALUE 'E',

c_update TYPE c VALUE 'S',

c_x TYPE c VALUE 'X',

c_0 TYPE i VALUE '0'.

SELECTION-SCREEN BEGIN OF BLOCK sb WITH FRAME TITLE text-000.

PARAMETERS: p_file LIKE rlgrap-filename OBLIGATORY DEFAULT

'C:\TEMPLATE.txt'.

SELECTION-SCREEN END OF BLOCK sb.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

PERFORM f4_filename USING 'P_FILE'

CHANGING p_file.

START-OF-SELECTION.

PERFORM upload_data.

PERFORM bdc_update.

ENDIF.

&----


*& Form f4_filename

&----


----


  • --> p_i_fieldname Fieldname

  • <-- p_e_return Return Path

----


FORM f4_filename USING p_i_fieldname

CHANGING p_e_return.

CALL FUNCTION 'F4_FILENAME'

EXPORTING

program_name = syst-cprog

  • DYNPRO_NUMBER = SYST-DYNNR

field_name = p_i_fieldname

IMPORTING

file_name = p_e_return

.

ENDFORM. " f4_filename

&----


*& Form upload_data

&----


----


FORM upload_data .

v_file = p_file.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = v_file

filetype = 'ASC'

has_field_separator = c_x

TABLES

data_tab = i_itab.

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. "upload_data

----


  • Start new screen *

----


FORM bdc_dynpro USING program dynpro.

CLEAR bdcdata.

bdcdata-program = program.

bdcdata-dynpro = dynpro.

bdcdata-dynbegin = 'X'.

APPEND bdcdata.

ENDFORM. "BDC_DYNPRO

----


  • Insert field *

----


FORM bdc_field USING fnam fval.

IF fval <> space.

  • IF FVAL <> NODATA.

CLEAR bdcdata.

bdcdata-fnam = fnam.

bdcdata-fval = fval.

APPEND bdcdata.

ENDIF.

ENDFORM. "BDC_FIELD

&----


*& Form BDC_REC1

&----


  • BDC Recording 1

----


  • --> p1 text

  • <-- p2 text

----


FORM bdc_rec1 .

PERFORM bdc_dynpro USING 'SAPLWBMESSAGES' '0100'.

PERFORM bdc_field USING 'BDC_CURSOR'

'MSG_NUMMER'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=WB_EDIT'.

PERFORM bdc_field USING 'RSDAG-ARBGB'

k_itab-arbgb. "'Z'.

PERFORM bdc_field USING 'RSDAG-MSGFLAG'

'X'.

PERFORM bdc_field USING 'MSG_NUMMER'

k_itab-msgnr. "'001'.

PERFORM bdc_dynpro USING 'SAPLWBMESSAGES' '1000'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=DOCU'.

PERFORM bdc_field USING 'BDC_CURSOR'

'T100-TEXT(01)'.

PERFORM bdc_field USING 'NUMMER'

k_itab-msgnr. "'001'.

PERFORM bdc_dynpro USING 'SAPLSTXX' '1100'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RSTXT-TXLINE(09)'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=TDGE'.

PERFORM bdc_field USING 'RSTXT-TXLINE(03)'

k_itab-text1. "'test1'.

PERFORM bdc_field USING 'RSTXT-TXLINE(05)'

k_itab-text2. "'test2'.

PERFORM bdc_field USING 'RSTXT-TXLINE(07)'

k_itab-text3. "'test3'.

PERFORM bdc_field USING 'RSTXT-TXLINE(09)'

k_itab-text4. "'test4'.

PERFORM bdc_dynpro USING 'SAPLSTXX' '1100'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RSTXT-TXLINE(09)'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=TDEN'.

PERFORM bdc_dynpro USING 'SAPLWBMESSAGES' '1000'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=WB_CANCEL'.

PERFORM bdc_field USING 'BDC_CURSOR'

'T100-TEXT(01)'.

PERFORM bdc_field USING 'NUMMER'

k_itab-msgnr. "'001'.

PERFORM bdc_dynpro USING 'SAPLWBMESSAGES' '0100'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RSDAG-ARBGB'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=WB_CANCEL'.

PERFORM bdc_field USING 'RSDAG-ARBGB'

k_itab-arbgb. "'Z'.

PERFORM bdc_field USING 'RSDAG-MSGFLAG'

'X'.

PERFORM bdc_field USING 'MSG_NUMMER'

k_itab-msgnr. "'001'.

ENDFORM. " BDC_REC1

&----


*& Form bdc_update

&----


  • BDC update

----


  • --> p1 text

  • <-- p2 text

----


FORM bdc_update .

LOOP AT i_itab INTO k_itab.

CLEAR: bdcdata.

REFRESH: bdcdata.

PERFORM bdc_rec1.

CALL TRANSACTION 'SE91' USING bdcdata MODE c_mode UPDATE c_update.

ENDLOOP.

ENDFORM. " bdc_update

Thank you very much.

good reply will be awaded.

2 REPLIES 2

Former Member
0 Kudos

Issue resolved

Former Member
0 Kudos

Closed