Skip to Content
-1

Combining 2 records into 1 record in an Internal Table

Hi All,

My requirement is as follows :

An Internal Table is having 4 Fields.

--------------------------------------------------------------------

Field 1 Field 2 Field 3 Field 4

ZHR_TEST_SINGLE_DATA_HRA Read 105 N

ZHR_TEST_SINGLE_DATA_HRA Create~Update 105 Y


Suppose Field 1 values & Field 3 Values are common, but Field 4 Value differs then value 'Y' will be having precedence over 'N' and merging of record will take place based on the example given above

Final Output after merging:

--------------------------------------------

ZHR_TEST_SINGLE_DATA_HRA Create~Update 105 Y


Please Guide.

Regards,

Ritiz

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Apr 06 at 12:32 PM

    Dear Ritiz

    Based on your comment, if you want to take Create-Update over Read, then you need to set a logic by giving number to each privilege and select the max one

    Example Read - 0, Create 1, Create-Update 2, Create-update-delete 3 etc

    Then instead of merging, select the max priviliege if the Field1-Field3 combination.

    Regards,

    Venkat

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Apr 06 at 11:38 AM

    Hi Ritiz

    Please provide clear and more detail about your requirement. You have not mentioned anything about field 2.

    Thanks,

    Rv

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Venkat,

      1.Yes , its Create~Update over Read.

      2.Let's say , all data is present in the internal table (Read / Create~Update). So based on 1st condition I need to make changes to retrieve records into a new internal table while merging Create~Update records with Read records only when Field 1 & Field 3 value matches.

      Someone suggested 'Collect' will be a good option. But the problem being I'm very new to ABAP. Not sure, how its different from 'Append'.

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.