10-15-2019 4:39 PM
How can i display multiple ship to party in one line with separating "/" in sales order status report for a particular sales order line item?
ex abc/xyz/pqr
10-15-2019 5:23 PM
Hello anjelo robin,
Are you talking about any custom Report ? Which report are you talking about? Can you please more clear?
Also To display the as per your requirement you Just need to use Concatenate Statement Separated by '/' as given below .
Below is just an example. But be clear with your requirement to proceed further.
CONCATENATE p1 p2 INTO p3 SEPARATED BY '/'.
10-16-2019 8:13 AM
Hi Sathis Kumar ,
Thanks for your advice and . following diagram will show my requirement.
10-16-2019 8:21 AM
Hi Angelo,
You can use the concatenate function as mentioned by Mr.Sathish Kumar.
In the report for the ship to party field do include the code as below.
CONCATENATE GS_TEST_SH1 GS_TEST_SH2 GS_TEST_SH3 GS_TEST_SH4 INTO gv_result SEPARATED BY '/'.
"Where GS_TEST_SH1,GS_TEST_SH2,GS_TEST_SH3,GS_TEST_SH4 are the ship to party variables and gv_result is output variable.
10-16-2019 1:36 PM
yes can concatenate . but the problem is i receive ship to party in one query then how can i take it . if not how can i take it separately . and arrange data
10-16-2019 1:57 PM
the old way, you create a duplicates internal table with all the data but not the ship to party. You remove duplicates (sort / delete adjacent duplicates)
and after you loop on this key table, inside you loop in the detailled table and you concatenate ...
10-18-2019 11:16 AM
Hi Anjelo,
I would recommend using a LOOP AT GROUP BY statement for this problem, below code sample should help you.
kind regards
Yor
TYPES:
BEGIN OF ty_example ,
a TYPE string,
b TYPE string,
END OF ty_example,
tt_example TYPE TABLE OF ty_example.
DATA:
lt_ab TYPE tt_example,
lt_aggregate TYPE tt_example.
APPEND VALUE #( a = 'test1' b = 'P' ) TO lt_ab.
APPEND VALUE #( a = 'test1' b = 'Q' ) TO lt_ab.
APPEND VALUE #( a = 'test1' b = 'R' ) TO lt_ab.
APPEND VALUE #( a = 'test2' b = 'Y' ) TO lt_ab.
APPEND VALUE #( a = 'test2' b = 'Z' ) TO lt_ab.
LOOP AT lt_ab INTO DATA(ls_ab) GROUP BY ( a = ls_ab-a ) ASSIGNING FIELD-SYMBOL(<ab>).
APPEND INITIAL LINE TO lt_aggregate ASSIGNING FIELD-SYMBOL(<aggregate>).
<aggregate>-a = <ab>-a.
LOOP AT GROUP <ab> INTO DATA(ls_single_ab).
IF <aggregate>-b IS INITIAL.
<aggregate>-b = ls_single_ab-b.
ELSE.
<aggregate>-b = <aggregate>-b && '/' && ls_single_ab-b.
ENDIF.
ENDLOOP.
ENDLOOP.
10-18-2019 11:32 AM
Hi Anjelo
Loop , Read (if required) and concatenate should resolve your issue.
Regards
Swathi
10-22-2019 10:59 PM
What exactly is the technical challenge?
The way the question is written, everyone (me including) understood it as a question about string concatenation.
But now plot thickens as the comment below states: "yes can concatenate . but the problem is i receive ship to party in one query then how can i take it . if not how can i take it separately . and arrange data"
Sorry but I'm having trouble understanding any of that. Where do you "receive" from and what does "can i take it" mean in ABAP terms?
Kindly make some effort to formulate the question more precisely and using common SAP terminology, so that others could understand it. See this blog on how to ask better questions to get good answers.