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

How can I go to next record in FM

There is a function module MATERIAL_UNIT_CONVERSION where I need to go to next record when an exception is raised.

CALL FUNCTION 'MATERIAL_UNIT_CONVERSION'

EXPORTING

INPUT = P_TBL_PLAF_VCAP_GSMNG

IMPORTING

OUTPUT = P_TBL_PLAF_VCAP_GSMNG

EXCEPTIONS

OVERFLOW = 8.

IF SY-SUBRC = 8.

" what should I write here

ENDIF.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Posted on Mar 17, 2009 at 06:15 PM

    If you calling in a loop, then just write "continue". thats it.

    Kuntal

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 17, 2009 at 06:15 PM

    P_TBL_PLAF_VCAP_GSMNG

    Is it a single record?

    and where ur fm is? is it in a subroutine?

    кu03B1ятu03B9к

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 17, 2009 at 06:18 PM

    I guess you need recursive programming here....

    Perform f_material_unit.

    form f_material_unit_conv.

    CALL FUNCTION 'MATERIAL_UNIT_CONVERSION'

    EXPORTING

    INPUT = P_TBL_PLAF_VCAP_GSMNG

    IMPORTING

    OUTPUT = P_TBL_PLAF_VCAP_GSMNG

    EXCEPTIONS

    OVERFLOW = 8.

    IF SY-SUBRC = 8.

    perform f_material_unit_conv.

    ENDIF.

    endform.

    Never had to do recursive programming in abap before but I think this will work.

    Mathews

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 17, 2009 at 06:20 PM

    Hi Annapurna,

    You need to call FM 'MATERIAL_UNIT_CONVERSION' in LOOP (of Material data?).

    If sy-subrc NE 0 Do CONTINUE. so it proceeds to the next record in loop.

    Regards

    Shital

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 17, 2009 at 06:23 PM

    Hi Kartik,

    The Function Module is in a Form and it is called multiple times in the program.

    Yes it is in Loop endloop ,but in the same loop the Form is called multiple times.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 18, 2009 at 02:35 AM

    Hi Annapurna,

    is ur program is like this.

    loop.

    perform mat_unit_conversion.

    endloop.

    form mat_unit_conversion.

    CALL FUNCTION 'MATERIAL_UNIT_CONVERSION'

    EXPORTING

    INPUT = P_TBL_PLAF_VCAP_GSMNG

    IMPORTING

    OUTPUT = P_TBL_PLAF_VCAP_GSMNG

    EXCEPTIONS

    OVERFLOW = 8.

    endform.

    if it is so.

    u can follow the below to skip the loop to process the next record,

    loop.

    perform mat_unit_conversion.

    if v_flag = 'X'.

    continue. " it will skip to the next loop.

    endloop.

    form mat_unit_conversion.

    data : v_flag.

    CALL FUNCTION 'MATERIAL_UNIT_CONVERSION'

    EXPORTING

    INPUT = P_TBL_PLAF_VCAP_GSMNG

    IMPORTING

    OUTPUT = P_TBL_PLAF_VCAP_GSMNG

    EXCEPTIONS

    OVERFLOW = 8.

    if sy-subrc = 8.

    v_flag = 'X'.

    exit. " it exits from the sub-routine.

    endif.

    endform.

    hope this will help u.

    << Please do not beg for points >>

    Guru

    Edited by: Rob Burbank on Mar 17, 2009 10:39 PM

    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.