Application Development and Automation 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: 
Read only

how make the values default for a table in BAPI

Former Member
0 Likes
677

Hi all,

I had developed a Remote Function module to display all the Pending Purchase orders.

In that i had declares PORANGE as input

In the table parameters i had declared PORANGE as

PORANGE LIKE YMM_SC_BAPIEBELN

YMM_SC_BAPIEBELN is a structure with fields as SIGN OPTION PO_LOW PO_HIGH

now i need to male the values SIGN and OPTION as Default

For that i had coded as below but its not working.



IF PORANGE-PO_LOW IS NOT INITIAL.

PORANGE-SIGN = 'I'.
PORANGE-OPTION = 'BT'.


ELSE.
  CLEAR PORANGE[].
ENDIF.

PORANGE[] is having the values which i passed but PORANGE is not containig any values.

Please suggest any solution.

Thanks in advance

Ajay

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
533

Please try using below code :


IF PORANGE[] IS NOT INITIAL.
    LOOP AT PORANGE INTO wa_PORANGE.
          IF wa_PORANGE-PO_LOW IS NOT INITIAL.
           wa_PORANGE-SIGN = 'I'.
           wa_PORANGE-OPTION = 'BT'.
          MODIFY PORANGE FROM wa_PORANGE TRANSPORTING SIGN OPTION.
          ENDIF.
          CLEAR : wa_PORANGE.
     ENDLOOP.
ELSE.
             CLEAR PORANGE[].
ENDIF.

Hope this helps.

Hi all,

I had developed a Remote Function module to display all the Pending Purchase orders.

In that i had declares PORANGE as input

In the table parameters i had declared PORANGE as

PORANGE LIKE YMM_SC_BAPIEBELN

YMM_SC_BAPIEBELN is a structure with fields as SIGN OPTION PO_LOW PO_HIGH

now i need to male the values SIGN and OPTION as Default

For that i had coded as below but its not working.



IF PORANGE-PO_LOW IS NOT INITIAL.

PORANGE-SIGN = 'I'.
PORANGE-OPTION = 'BT'.


ELSE.
  CLEAR PORANGE[].
ENDIF.

PORANGE[] is having the values which i passed but PORANGE is not containig any values.

Please suggest any solution.

Thanks in advance

Ajay

2 REPLIES 2
Read only

Former Member
0 Likes
534

Please try using below code :


IF PORANGE[] IS NOT INITIAL.
    LOOP AT PORANGE INTO wa_PORANGE.
          IF wa_PORANGE-PO_LOW IS NOT INITIAL.
           wa_PORANGE-SIGN = 'I'.
           wa_PORANGE-OPTION = 'BT'.
          MODIFY PORANGE FROM wa_PORANGE TRANSPORTING SIGN OPTION.
          ENDIF.
          CLEAR : wa_PORANGE.
     ENDLOOP.
ELSE.
             CLEAR PORANGE[].
ENDIF.

Hope this helps.

Read only

Former Member
0 Likes
533

Hello,

I don't understand the problem you have. But, if you want to pass a range as a parameter for a module function, you have two options:

1. Declare your PORANGE as import parameter, and data type must be TYPE TABLE of YMM_SC_BAPIEBELN. You can make a new Table Type for your YMM_SC_BAPIEBELN in SE11. Or

2. Declare your PORANGE as tables parameter.

Then you can use PORANGE in Select statements, as normally.

Regards,

Julio Almeida