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

internal tables

Former Member
0 Likes
1,060

i am working on customer master extract,writing a simple report program to download the data into a file.I have to check if the partner function(parvw) is ship to and then check if the customer number of business partner(kunn2) is same as that of customer no(kunnr).If both the conditions are true then output the ship to address also in the file ow keep the place blank.I appreciate if anyone can suggest me the simple way of doing this

i am working on customer master extract,writing a simple report program to download the data into a file.I have to check if the partner function(parvw) is ship to and then check if the customer number of business partner(kunn2) is same as that of customer no(kunnr).If both the conditions are true then output the ship to address also in the file ow keep the place blank.I appreciate if anyone can suggest me the simple way of doing this

8 REPLIES 8
Read only

Former Member
0 Likes
1,017

Hi

use knvp table parvw = 'WE' for ship o

Regards

Amole

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,017

Which part are you struggling with? If you need to know the tables, please check KNVP field PARVW = 'WE'(SH is the enternal format).

Regards,

Rich Heilman

Read only

Former Member
0 Likes
1,017

Hi,

select kunnr from knvp into table lv_kunnr

where kunn2 = kunnr

and parvw = 'WE'

select adrnr from kna1 where kunnr = lv_kunnr.

adrnr = ship to address

Regards

Amole

Read only

Former Member
0 Likes
1,017

I have written something like this

LOOP AT ITAB.

IF ITAB-PARVW = 'WE' AND ITAB-KUNN2 <> ITAB-KUNNR.

READ TABLE ITAB INTO WA WITH KEY KUNNR = ITAB-KUNN2.

ITAB-SNAME1 = WA-NAME1.

ITAB-SNAME2 = WA-NAME2.

ITAB-SORT01 = WA-ORT01.

ITAB-SPSTLZ = WA-PSTLZ.

ITAB-SREGIO = WA-REGIO.

ITAB-SSTRAS = WA-STRAS.

ITAB-STELBX = WA-TELBX.

ITAB-STELF1 = WA-TELF1.

ELSE.

ITAB-SNAME1 = ' '.

ITAB-SNAME2 = ' '.

ITAB-SORT01 = ' '.

ITAB-SPSTLZ = ' '.

ITAB-SREGIO = ' '.

ITAB-SSTRAS = ' '.

ITAB-STELBX = ' '.

ITAB-STELF1 = ' '.

ENDIF.

ENDLOOp

Read only

Former Member
0 Likes
1,017

how can i download the file with a comma delimiter, i am working on 3.1h and using the function download .I appreciate your response

Read only

0 Likes
1,017

You can declare a flat structured internal table.

data: begin of itabout occurs 0,
       rec(1000) type c,
      end of itabout.

Then you can loop your internal table and build the ITABOUT using the data from the first.

Loop at itab.
   concatenate itab-kunnr itab-parvw itab-kunn2
                into itabout separated by ','.
   append itabout.
endloop.

Then use the ITABOUT in your function module.

Regards,

Rich Heilman

Read only

0 Likes
1,017

Hi

I don't remember which tools are in 3.1h, but you can use the options to elaborate a string.

DATA: BEGIN OF T_DATA_FILE OCCURS 0,

RECORD(1000),

END OF T_DATA_FILE.

.............................

CLEAR T_DATA_FILE-RECORD.

PERFORM MOVE_FIELD: <FIELD1>,

<FIELD2>,

<FIELD3>,

........

<FIELDN>.

APPEND T_DATA_FILE.

CLEAR T_DATA_FILE-RECORD.

.............................

FORM MOVE_FIELD USING FIELD.

DATA: V_LEN TYPE I.

V_LEN = STRLEN( T_DATA_FILE-RECORD ).

MOVE FIELD TO T_DATA_FILE-RECORD+V_LEN.

V_LEN = STRLEN( T_DATA_FILE-RECORD ).

MOVE ',' TO T_DATA_FILE-RECORD+V_LEN.

ENDFORM.

Max

Read only

0 Likes
1,017

there are about 50 fields , is there any other way of using the same concatenate statement or do i need to mention all those fields in the concatenate statement.