Skip to Content

Logic correct but data wrong/junk

Hi,

Doing load to 0CUSTOMER from data source.

*** Select from DSO the PCUSTOMER value ***

SELECT CUSTOMER

PCUSTOMER FROM ZDSO INTO temp FOR ALL ENTRIES IN SOURCE_PACKAGE

WHERE CUSTOMER = SOURCE_PACKAGE-KUNNR.

SORT temp BY CUSTOMER.

*** Copy of source package ***

REFRESH tsource_package.

LOOP AT SOURCE_PACKAGE INTO wsource_package.

APPEND wsource_PACKAGE INTO tsource_package.

ENDLOOP.

SORT tsource_package BY KUNNR.

In Field routine:

CLEAR wtemp.

CLEAR w1source_PACKAGE.

READ TABLE temp INTO wtemp WITH KEY CUSTOMER = source_PACKAGE-KUNNR BINARY SEARCH.

If sy-subrc = 0.

READ TABLE tsource_package INTO w1source_PACKAGE

WITH KEY KUNNR = wtemp_/BIC/-PCUSTOMER BINARY SEARCH.

If sy-subrc = 0.

RESULT = w1source_PACKAGE-NAME.

ENDIF.

ENDIF.

The above code works fine with the selected customer nos.

But same code gives junk data (Data of other field which is NOT mapped in any way) or no data with full/delta DTP run

Data package is 50000.

Am guessing, PCUSTOMER might not be in the current data package for a source KUNNR?

Will the DTP check for all the records of PSA say 200000 records for PCUSTOMER value mapped to source KUNNR or ONLY 50000 data package records?


How to overcome this?

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Posted on Jan 09, 2014 at 05:46 PM

    Hi,

    Few points which i suggested in your other thread also which is related to same issue.

    1. Field level routine part should be moved to end routine.
    2. Add IF source_package is not initial.before the select statement.
    3. Semantic keys for customer should be selected in DTP.
    4. Once try to increase the data package size to maximum limit,just to check if this solves the issue or not.
    5. Also try to debug and understand where exactly the problem is.

    Regards,

    AL

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi,

      Except performance, any advantage of moving the field to End? Because the logic seems to work fine for selected records which also include PCUSTOMER.

      Semantic key for KUNNR is being maintained.

      Will try to increase the package size once and see, but whats the recommended one from performance of DTP?

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2014 at 08:19 PM

    Hi Aditya,

    Check if symentic keys are maintained in DTP for customer.

    And you can move the code to end routine from field routine for better performance.

    Also put a check on source_PACKAGE-KUNNR IS NOT INITIAL in the field routine if it is really important to use field routine else go for end routine.

    And Junk values could be because of you are not clearing the RESULT (I think it may be already cleared up but better check it in debug) .

    Delete the blank entries from tsource_package, it should help.

    Regards

    Amit

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 10, 2014 at 04:28 AM

    Dear Aditya

    Why cant you try this field routine

    SELECT SINGLE PCUSTOMER FROM ZDSO INTO LV_PCUSTOMER

    WHERE CUSTOMER = SOURCE_PACKAGE-KUNNR.

    IF sy-subrc = 0.

    RESULT = LV_PCUSTOMER.

    ELSE.

    RESULT = ' '.

    ENDIF.

    Regards

    Gajesh

    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.