Skip to Content
-1

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

Add a comment
10|10000 characters needed characters exceeded

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

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

  • Hi Sathis Kumar ,

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

    sapr1.png (16.3 kB)

Assigned Tags

Related questions

3 Answers

  • Posted on Oct 16, 2019 at 07: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.
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 18, 2019 at 10: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.
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 18, 2019 at 10:32 AM

    Hi Anjelo

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

    Regards

    Swathi

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.