Skip to Content

Routine

Hello, I'm looking for a dtp routine which deletes records. The scenario is we have a open hub which generates a flat file for Fed ex. There are some materials that I do not want to send in my flat file and want to delete in dtp routine. Does anyone have a sample dtp routine with this type of requirement please or help me writing one routine?

Thanks.

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    Posted on Nov 04, 2015 at 02:22 PM

    Hi Sunil,

    Instead of writing a routine you can eliminate the records using the exclude filter option in the DTP.

    Or is there any specific requirement which can only be achieved by a routine?

    Regards,

    Amit

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 04, 2015 at 02:26 PM

    Hi Sunil

    The deletion of records is possible in transformation level. In DTP level, you can filter out the records that you don't need.

    On what condition, you need the deletion/filter to function?

    For example, if you don't want to send any blank materials, below is the code which you could use in transformation end routine.

    LOOP AT RESULT_PACKAGE ASSIGNING <RESULT_FIELDS>

    DELETE RESULT_PACKAGE IF MATERIAL = ' '.

    ENDLOOP.

    You can simply filter out blank materials in DTP level. This is a simple scenario. Please give us your condition for deletion, we could work out something

    Regards

    Karthik

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 05, 2015 at 02:07 AM

    Hello Sunil,

    Instead of looping, you can declare ranges table , include material(or whatever field as per your requirement) , then directly use Where Clause to delete those entries...

    Sample code:-

    Scenario A:-

    **declare range table:

    Ranges: S_matnr FOR MARA-MATNR.

    *** insert material number which you want to delete...

    S_matnr-sign = 'I'.

    S_matnr-option = 'EQ'.

    S_matnr-low = 'Material1'.

    APPEND S_matnr.

    S_matnr-sign = 'I'.

    S_matnr-option = 'EQ'.

    S_matnr-low = 'Material2 '.

    APPEND S_matnr.

    ** finally delete those material from Internal table.

    DELETE SOURCE_PACKAGE WHERE MATNR IN S_MATNR.

    Scenario 2:-

    **Delete balnk entries

    DELETE SOURCE_PACKAGE WHERE MATNR = ' '.


    ***all this type of requirement of deletion , write code in START_ROUTINE.

    *** avoid Looping on source/result as much as possible



    Regards,

    Hitesh

    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.