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

problem in bdc code

Former Member
0 Likes
559

Hi,

when i am executing the following code, i am getting an error message 'TEXT 100000003000312 ID KOPF language EN not found'.

i have written the code to change the length of each row of text from 72ch to 32ch.

what this error message exactly mean? where is the problem

&----


*& Report ZM_CHANGEORDER_BDC *

*& *

&----


*& *

*& *

&----


----


*Purpose: The purpose of this shadow assignment is to change

  • text length of operation short text field from 72CH

  • to 32CH using BDC.

  • IW32 is CHANGE ORDER.

----


  • Author : Papiya Maitra - Rapidigm India

  • Development class : $TMP

  • Date : 03/17/2006

----


REPORT z6pm_changeorder_bdc NO STANDARD PAGE HEADING MESSAGE-ID zp.

----


  • Type Declaration *

----


TYPES: BEGIN OF type_aufk,

aufnr TYPE aufnr,

ktext TYPE auftext,

END OF type_aufk.

DATA: it_aufk TYPE STANDARD TABLE OF type_aufk.

DATA: wa_aufk TYPE type_aufk.

TYPES: BEGIN OF type_tline.

INCLUDE STRUCTURE tline.

TYPES: END OF type_tline.

DATA: it_line TYPE STANDARD TABLE OF type_tline.

TYPES: BEGIN OF type_bdc.

INCLUDE STRUCTURE bdcdata.

TYPES: END OF type_bdc.

DATA: it_bdc TYPE STANDARD TABLE OF type_bdc.

DATA: wa_bdc TYPE type_bdc.

TYPES: BEGIN OF type_thead.

INCLUDE STRUCTURE thead.

TYPES: END OF type_thead.

DATA: it_thead TYPE STANDARD TABLE OF type_thead.

DATA: v_name LIKE thead-tdname.

DATA: v_aufnr1 TYPE aufnr.

DATA: V_AUFNR TYPE AUFNR.

----


  • Selection Screen *

----


SELECTION-SCREEN BEGIN OF BLOCK b1.

SELECT-OPTIONS: s_aufnr FOR V_AUFNR.

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2.

PARAMETERS : p_ct RADIOBUTTON GROUP radi DEFAULT 'X',

p_s RADIOBUTTON GROUP radi .

SELECTION-SCREEN END OF BLOCK b2.

----


  • At Selection Screen *

----


AT SELECTION-SCREEN.

IF NOT S_aufnr IS INITIAL.

SELECT aufnr

UP TO 1 ROWS

INTO v_aufnr1

FROM aufk

WHERE aufnr in S_aufnr.

ENDSELECT.

IF sy-subrc <> 0.

MESSAGE e025.

ENDIF.

ENDIF.

----


  • Start of Selection *

----


START-OF-SELECTION.

PERFORM zfetch_data.

IF p_ct = 'X'.

LOOP AT it_aufk INTO wa_aufk.

PERFORM zbdc.

CALL TRANSACTION 'IW32' USING it_bdc MODE 'A'.

ENDLOOP.

ENDIF.

IF p_s = 'X'.

CALL FUNCTION 'BDC_OPEN_GROUP'

EXPORTING

client = sy-mandt

group = 'Z6PM'

keep = 'X'

user = 'DEVELOPER'

EXCEPTIONS

group_invalid = 3

group_is_locked = 4

internal_error = 6

queue_error = 7

running = 8

system_lock_error = 9

user_invalid = 10

OTHERS = 11.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

LOOP AT it_aufk INTO wa_aufk.

PERFORM zbdc.

CALL FUNCTION 'BDC_INSERT'

EXPORTING

tcode = 'IW32'

TABLES

dynprotab = it_bdc

EXCEPTIONS

internal_error = 1

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.

ENDLOOP.

CALL FUNCTION 'BDC_CLOSE_GROUP'

EXCEPTIONS

not_open = 1

queue_error = 2

OTHERS = 3.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

ENDIF.

&----


*& Form ZFETCH_DATA

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM zfetch_data .

SELECT aufnr ktext

FROM aufk

INTO TABLE it_aufk

WHERE aufnr IN S_aufnr.

IF sy-subrc <> 0.

MESSAGE e025.

ENDIF.

ENDFORM. " ZFETCH_DATA

&----


*& Form ZBDC

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM zbdc .

v_name = wa_aufk-aufnr.

REFRESH it_bdc.

PERFORM z_bdc USING 'SAPLCOIH' '0101' 'X' '' ''.

PERFORM z_bdc USING '' '' '' 'BDC_OKCODE' '=VGUE'.

PERFORM z_bdc USING '' '' '' 'CAUFVD-AUFNR' wa_aufk-aufnr.

PERFORM z_bdc USING 'SAPLCOIH' '3000' 'X' '' ''.

PERFORM z_bdc USING '' '' '' 'BDC_OKCODE' '=BU'.

CONCATENATE sy-mandt v_name INTO v_name.

CALL FUNCTION 'READ_TEXT'

EXPORTING

client = sy-mandt

id = 'KOPF'

language = 'E'

name = v_name

object = 'AUFK'

  • ARCHIVE_HANDLE = 0

  • LOCAL_CAT = ' '

  • IMPORTING

  • HEADER =

TABLES

lines = it_line

EXCEPTIONS

id = 1

language = 2

name = 3

not_found = 4

object = 5

  • REFERENCE_CHECK = 6

  • WRONG_ACCESS_TO_ARCHIVE = 7

OTHERS = 8

.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

CALL FUNCTION 'FORMAT_TEXTLINES'

EXPORTING

  • CURSOR_COLUMN = 0

  • CURSOR_LINE = 0

  • ENDLINE = 99999

formatwidth = 32

  • LINEWIDTH = 132

  • STARTLINE = 1

language = sy-langu

  • IMPORTING

  • NEW_CURSOR_COLUMN =

  • NEW_CURSOR_LINE =

TABLES

lines = it_line

EXCEPTIONS

bound_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.

PERFORM z_bdc USING '' '' '' 'CAUFVD-KTEXT' wa_aufk-ktext.

ENDFORM. " ZBDC

&----


*& Form Z_BDC

&----


  • text

----


  • -->P_0205 text

  • -->P_0206 text

  • -->P_0207 text

  • -->P_0208 text

  • -->P_0209 text

----


FORM z_bdc USING p_program

p_dynpro

p_dynbegin

p_fnam

p_fval.

CLEAR wa_bdc.

IF p_dynbegin = 'X'.

wa_bdc-program = p_program.

wa_bdc-dynpro = p_dynpro.

wa_bdc-dynbegin = p_dynbegin.

ELSE.

wa_bdc-fnam = p_fnam.

wa_bdc-fval = p_fval.

ENDIF.

APPEND wa_bdc TO it_bdc.

ENDFORM. " Z_BDC

2 REPLIES 2
Read only

Former Member
0 Likes
442

Hi sangeeta,

1. this error is regarding

OPEN_TEXT

2. the system is not able

to find that text

of the key 100000003000312 (production order i suppose)

and ID KOPF .

regards,

amit m.

Read only

0 Likes
442

Hi

In your BDC the text KOPF (id = 'KOPF')that you have defined has not been identified properly. So you have to assgin that field properly, means you have to check with the value that you r passing in the sap script form.

I hope this will help you to solve your problem.

Thanks

Mrutyunjaya Tripathy