Skip to Content
author's profile photo Former Member
Former Member

Issue with the routine

Hi Friends,

I wrote a lookup in transformations to get a field called assignment from FIAR DSO and put it in FIGL DSO. I wrote a end routine but it is throwing an error. Please look into it and let me know what i have done wrong.

The error is showing as "You cannot use an internal table as a work area" Please look into the screen shots for the code.

Thanks,

Global declarations below:

Logic below:

Thanks,

Karthik

logic.png (119.0 kB)
logic.png (119.0 kB)
Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 15, 2015 at 10:54 AM

    Thanks all for the help. I cleared the issue with the help of my Abaper.


    new.png (120.2 kB)
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 15, 2015 at 10:49 AM

    Hi Karthik,

    Your lookup is completely done in the end routine, so there's no need to declare anything globally (leave the 1st and 2nd part global empty).

    Try this:



    TYPES: BEGIN OF ty_fiar,

    COORDER TYPE /BI0/OICOORDER,

    DOC_NUM TYPE /BI0/OIDOC_NUM,

    COMP_CODE TYPE /BI0/OICOMP_CODE,

    /BIC/ZIA_ASIGN TYPE /BIC/OIZIA_ASIGN,

    END OF ty_fiar.

    DATA: lt_fiar TYPE SORTED TABLE OF ty_fiar

    WITH NON-UNIQUE KEY COORDER,

    ls_fiar TYPE ty_fiar.

    SELECT COORDER

    DOC_NUM

    /BIC/ZIA_ASIGN

    FROM /BIC/AZKA_FIAR00

    INTO CORRESPONDING FIELDS OF TABLE lt_fiar

    FOR ALL ENTRIES IN RESULT_PACKAGE

    WHERE COORDER EQ RESULT_PACKAGE-COORDER

    AND COMP_CODE EQ RESULT_PACKAGE-COMP_CODE.

    LOOP AT RESULT_PACKAGE ASSIGNING <RESULT_FIELDS>.

    IF NOT <RESULT_FIELDS>-COORDER IS INITIAL.

    READ TABLE lt_fiar INTO ls_fiar

    WITH KEY COORDER = <RESULT_FIELDS>COORDER.

    IF sy-subrc = 0.

    <RESULT_FIELDS>-/BIC/ZIA_ASIGN = ls_fiar-/BIC/ZIA_ASIGN.

    ENDIF.

    ENDIF.

    ENDLOOP.



    Hope it will work for you.


    Rgds,


    René

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 15, 2015 at 08:05 AM

    The select statement needs to be modified:

    SELECT .... INTO TABLE IT_FIAR.

    Also, please look into the naming conventions and performance of the code. For instance, DISTINCT should be avoided, it degrades performance.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 15, 2015 at 11:12 AM

    Hi,

    1. Don't keep select inside loop. It should be outside the loop.

    2. Write the code: select

    Icoorder

    .................

    ............................

    ........................ from /bic/azka_fiar00 into table it_fiar for all entries in result_package where <condition>.

    3. Debug the code.

    4. replace work area with field symbol<result-fields>. No needs to use modify the result-package.

    Thanks,

    Swapna Jain

    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.