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: 

How to Display multiple ship to party

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

8 REPLIES 8

former_member1716
Active Contributor

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 '/'.

0 Kudos

Hi Sathis Kumar ,

Thanks for your advice and . following diagram will show my requirement.

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.

0 Kudos

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

FredericGirod
Active Contributor

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 ...

YorRombaut
Participant
0 Kudos

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.

sv_v
Explorer

Hi Anjelo

Loop , Read (if required) and concatenate should resolve your issue.

Regards

Swathi

Jelena
Active Contributor
0 Kudos

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.