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: 

Long Text To Be Modified

Former Member
0 Kudos

hi experts ..

iam beinng stuck in problem where long text is to be modified but didnt got any helpfull answer till now pls any body there who had done bdc for QP02 --inspection plan characterstic .. with long text to be modifeid with respective characterstic.

i created a internal table for long text and iam reading it with keys..

but the problem is suppose one material .. i have to modfiy 3 charstic ..

material plnt plnnr plnal oper char longtxt

105012 3011 1001 1 1 10 long text1

20 longtext2.

105013 3110 1001 1 1 10 long text1

now when it run for 105012 matnr

it goes into text screen and after the 20 charstic it is overwriting the same matnr with the contents of 105013.

here is my code.

pls do correct me where iam wrong.

loop at ichr.

PERFORM bdc_dynpro USING 'SAPLQPAA' '0150'.

PERFORM bdc_field USING 'BDC_CURSOR'

'PLMKB-AUSWMENGE1(10)'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'RQPAS-QUANTITAT(01)'

wa_ichr-quantitat .

PERFORM bdc_field USING 'RQPAS-QUALITAT(01)'

wa_ichr-qualitat.

READ TABLE itext WITH KEY matnr = wa_ichr-matnr

plnnr = wa_ichr-plnnr

plnal = wa_ichr-plnal

verwe = wa_ichr-verwe

werks = wa_ichr-werks

vornr = wa_ichr-vornr

merknr = wa_ichr-merknr.

IF sy-subrc = 0.

  • LOOP AT itext WHERE merknr = wa_ichr-merknr.

PERFORM long_text.

  • ENDLOOP.

*

ENDIF.

ENDAT.

ENDLOOP." Loop at ichr

3 REPLIES 3

Former Member
0 Kudos

FQ ,

dont Modify Long text by using BDC , try to USE FMs SAVE_TEXT.

for more info check the Documentation of this FM

Regards

Prabhu

Former Member
0 Kudos

TO change/modify long texts you should use SAVE_TEXT function module.

populate all the data into an internal table and pass this to the above function module.

here is the link,how to use SAVE_TEXT

and also,

regards

srikanth

Former Member
0 Kudos

Hi,

I think the BDC program is not upload lontext properly.

But we have to use function module CREATE_TEXT.

To pass import parameters as below

tdid = 'PLKO'.

tdobject = 'ROUTING'.

tdspras = 'E'.

Note: 1. goto tcode QP02

2. enter material, plant and Group value

3. press enter

4. select one item row

5. then select long text icon button on toolbar

6. it shows long text editor

7. selct goto menu and select header menu button

8. here it shows like below

Text Name 800Q000000120500000005

tdid = 'PLKO'.

tdobject = 'ROUTING'.

tdspras = 'E'.

TDNAME VALUE concatenate like below( please check your text name in header, the 4th character value is placed into value 'Q' in below concatenate statement)

concatenate SY-MANDT 'Q' plnnr plnal

'000000' plnal into tdname.

data:i_tline type standard table of tline initial size 0,

wa_tline type tline.

To pass tables as below like

wa_tline-tdformat = '*'.

wa_tline-tdline = your Longtext.

append wa_tline to i_tline.

Please refer my sample below code, i think it is useful for you

loop at i_mast1 into wa_mast1.

move wa_mast1 to wa_mast2.

clear wa_mast1.

at new plnal.

tdid = 'PLKO'.

tdobject = 'ROUTING'.

tdspras = 'E'.

concatenate SY-MANDT '2' wa_mast2-plnnr wa_mast2-plnal

'000000' wa_mast2-plnal into tdname.

endat.

wa_tline-tdformat = '*'.

wa_tline-tdline = text-002.

append wa_tline to i_tline.

clear wa_tline.

at end of plnal.

CALL FUNCTION 'CREATE_TEXT'

EXPORTING

FID = tdid

FLANGUAGE = tdspras

FNAME = tdname

FOBJECT = tdobject

SAVE_DIRECT = 'X'

TABLES

FLINES = i_tline

EXCEPTIONS

NO_INIT = 1

NO_SAVE = 2

OTHERS = 3.

IF SY-SUBRC <> 0.

ENDIF.

clear: tdid, tdname, tdobject, tdspras.

refresh i_tline.

endat.

clear: wa_mast1, wa_mast2, wa_matnr, wa_plko.

endloop.

rewards if helpfull.

Regards,

Subbarao