Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Function Module

Former Member
0 Kudos

Hello friends, I am using the function Module,

PM_ORDER_DATA_READ with a loop and endloop.

The first time when this function module triggers i see no problem and everything works fine.

But when it triggers the second time in the loop, it gives a short dump.

Any suggestions.

Ster

Below is the code.

LOOP AT t_resb.
    CLEAR : v_ktext,v_ingpr,v_objnr,v_lgpbe,v_bismt,
            v_mmsta,v_text,v_maktx, v_iloan, v_kostl.

    CALL FUNCTION 'PM_ORDER_DATA_READ'
      EXPORTING
        order_number          = t_resb-aufnr
*   CALL_FROM_NOTIF       =
*  IMPORTING
*   WCAUFVD               =
*   WILOA                 =
*   WRIWO1                =
       TABLES
*   IAFFHD                =
        iafvgd                = t_oper
        iresbd                = tmp_resb
*   IRIPW0                =
*   OP_PRINT_TAB          =
        ihpad_tab             = t_ihpad
*   IHSG_TAB              =
*   IHGNS_TAB             =
*   KBEDP_TAB             =
     EXCEPTIONS
       order_not_found       = 1
       itab_error            = 2
       OTHERS                = 3
              .
    IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

    REFRESH : t_oper, tmp_resb, t_ihpad.
    CLEAR: t_oper, tmp_resb, t_ihpad.

  ENDLOOP.

11 REPLIES 11

Former Member
0 Kudos

Use CLEAR t_resb beore ENDLOOP.

Regards,

Amey

Message was edited by:

Amey Potale

0 Kudos

Thansk I have used it but no change it still goes to dump.

Ster

0 Kudos

Try using work area i.e. loop at ITAB into workarea.

and then pass workarea field to your fucntion module.

Regards,

Amey

0 Kudos

Thanks Amey, No improvement.

Let me tel you something i did and find the same error while exevuting the FM in se37.

When i execute for the forst time it works fine and came back and execute for the second time goes to dump and have the same error. However during the execution of FM in se37 if i come out completely out of the screen and reexecute it it dosent go to dup. Si ai am confused whats the problem.

Ster

0 Kudos

That means it is not committing the work.

try to add COMMIT WORK after your function module.

and if you have very less no. of records in internal table than also try to add WAIT of 1 or 2 seconds.

Regards,

Amey

PS: Not sure on this, but I guess it should work.

suresh_datti
Active Contributor
0 Kudos

You can try putting a FREE MEMORY statement before ENDLOOP.

~Suresh

0 Kudos

Thanks suresh. if I put free memory before endloop would it effect other user in the company using the same system.

Ster.

Former Member
0 Kudos

Any suggestions.

Ster

0 Kudos

FREE MEMORY deletes all data cluster from the ABAP memory, so it's not a SAP Memory so you can use that.

Regards,

Amey

0 Kudos

Try with Free Memory...

Thanks,

J Kumar.

0 Kudos

Try Free Memory.

Shreekant