2006 Aug 31 4:48 PM
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
2006 Aug 31 4:51 PM
2006 Aug 31 4:53 PM
2006 Aug 31 4:57 PM
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
2006 Aug 31 6:28 PM
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
2006 Aug 31 6:29 PM
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
2006 Aug 31 6:32 PM
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
2006 Aug 31 6:41 PM
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
2006 Aug 31 7:23 PM
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.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |