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: 

Condition Checking with " IF " statement....

Former Member
0 Kudos

Hi All,

In one of my requirement ,the existing scenario is like this: IF currency is USD, then call subroutine X

ELSE call subroutine Y. i.e if po_headers-waers = 'USD'

Perform fill_bdc_table using ' ' 'RV61A-KOEIN(01)' 'US4'.

else.

Perform fill_bdc_table using ' ' 'RV61A-KOEIN(01)' po_headers-waers .

endif.

(The above code first check if po_header currency value is 'USD' then it calls subroutine to convert the currency to US4,else it calls other subroutine to convert currency as per po_header currency value.)

Now my new requirement is : if po_header currency value is USD and po item value(po_items-netpr) is greater than '10000000.00', then call subroutine to convert it into USD, else for po_header currency value USD and po item value(po_items-netpr) is lesser than '10000000.00', call subroutine to convert into US4(as written above US4 code line).

I have inserted code for the condition like this:

if po_headers-waers = 'USD'

and po_items-netpr GE '10000000.00'.

Perform fill_bdc_table using ' ' 'RV61A-KOEIN(01)' po_headers-waers.

else.

Perform fill_bdc_table using ' ' 'RV61A-KOEIN(01)' 'US4'.

endif.

But it only satisfies one condition i.e for po_items-netpr >= '10000000.00' with currency as USD , it is converting to USD,but for po_items-netpr < '10000000.00' with currency as USD, it is not converting to US4.where i am missing the steps? can you all through some light.

Thanx.

Deb

4 REPLIES 4

Former Member
0 Kudos
if po_headers-waers = 'USD'
and po_items-netpr GE '10000000.00'.
Perform fill_bdc_table using ' ' 'RV61A-KOEIN(01)' po_headers-waers.
else.
 if po_items-netpr LE '10000000.00'.                          " Use If condition here
Perform fill_bdc_table using ' ' 'RV61A-KOEIN(01)' 'US4'.
endif.
endif.

regards,

gurpreet

Former Member
0 Kudos

hi,

Modify the code as following.

if po_headers-waers = 'USD' .
  if po_items-netpr GE '10000000.00'.
    Perform fill_bdc_table using ' ' 'RV61A-KOEIN(01)' po_headers-waers.
  else.
    Perform fill_bdc_table using ' ' 'RV61A-KOEIN(01)' 'US4'.
  endif.
endif.

Regards

Sharath

Former Member
0 Kudos

Hi try using this.

if po_headers-waers = 'USD'.

if po_items-netpr GE '10000000.00'.

Perform fill_bdc_table using ' ' 'RV61A-KOEIN(01)' po_headers-waers.

else.

Perform fill_bdc_table using ' ' 'RV61A-KOEIN(01)' 'US4'.

endif.

endif.

reaghrads

Former Member
0 Kudos

Hi !

if po_headers-waers = 'USD'.

if po_items-netpr GE '10000000.00'.

Perform fill_bdc_table using ' ' 'RV61A-KOEIN(01)' po_headers-waers.

else.

Perform fill_bdc_table using ' ' 'RV61A-KOEIN(01)' 'US4'.

endif.

endif.

Edited by: Paresh Gangani on Mar 30, 2009 1:08 PM