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

fetch data from READ_TEXT functn. modul.& to update exist.Internal table

Former Member
0 Likes
602

1.) I have one internal table where :- itemp

I have one internal table

LINE1 | KUNNR | VKORG | SPART | MATNR | VBELN | XTLINE1

1 | 23769 | DSMK | GS | 1213 | 6010002666|

2 | 23773 | DSMK | GS | 1231 | 6010002667|

3 | 23769 | DSMK | GS | 1213 | 6010002666|

-


2.) Now within XTLINE we have following data :-

XTLINE-TDLINE ( from READ_TEXT function module ) for VBELN = 6010002666

QTY 10 DATE 30.02.2010

QTY 50 DATE 30.01.2010

XTLINE-TDLINE ( from READ_TEXT function module ) for VBELN = 6010002667

QTY XX

QTY YY

This data needs to be updated in XTLINE1 in above internal table itemp1.

Provide me the logic to update the internal table itemp

-


-


1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
550

yes you need to call read_text in each loop pass for each document number.

loop at itab.
* call function 'READ_TEXT'
* move the text field to itab.
modify itab transporting xline1.
endloop.

1.) I have one internal table where :- itemp

I have one internal table

LINE1 | KUNNR | VKORG | SPART | MATNR | VBELN | XTLINE1

1 | 23769 | DSMK | GS | 1213 | 6010002666|

2 | 23773 | DSMK | GS | 1231 | 6010002667|

3 | 23769 | DSMK | GS | 1213 | 6010002666|

-


2.) Now within XTLINE we have following data :-

XTLINE-TDLINE ( from READ_TEXT function module ) for VBELN = 6010002666

QTY 10 DATE 30.02.2010

QTY 50 DATE 30.01.2010

XTLINE-TDLINE ( from READ_TEXT function module ) for VBELN = 6010002667

QTY XX

QTY YY

This data needs to be updated in XTLINE1 in above internal table itemp1.

Provide me the logic to update the internal table itemp

-


-


3 REPLIES 3
Read only

Former Member
0 Likes
550

Hi,

Please see a high level code below:

Expecting you are calling read_text function module in a loop at itemp.

Put the below code in that loop.

itemp-xtline1[] = xtline[].

modify itemp.

Please note the itemp-xtline1 is type table tline

Cheers.

Read only

Former Member
0 Likes
551

yes you need to call read_text in each loop pass for each document number.

loop at itab.
* call function 'READ_TEXT'
* move the text field to itab.
modify itab transporting xline1.
endloop.

Read only

0 Likes
550

Hi,

May be this code will help u.

DATA : TLINES1 TYPE TLINE OCCURS 0,

l_vbeln LIKE THEAD-TDNAME,

WA_LINE1 TYPE TLINE,

temp type string.

Loop at itemp.

REFRESH TLINES1.

l_vbeln = itemp-vbeln.

CALL FUNCTION 'READ_TEXT'

EXPORTING

CLIENT = SY-MANDT

ID = ' '

LANGUAGE = 'E'

NAME = L_vbeln

OBJECT = ' '

TABLES

LINES = TLINES1

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.

FLAG = 1.

ELSEIF SY-SUBRC = 0.

FLAG = 0.

LOOP AT TLINES1 INTO WA_LINE1.

T_LONG_TEXT-TDLINE = WA_LINE1-TDLINE.

APPEND T_LONG_TEXT.

ENDLOOP.

ENDIF.

clear temp.

APPEND LINES OF t_long_text to temp.

itemp-txline1 = temp.

modify itemp transproting txline1.

endloop.