cancel
Showing results for 
Search instead for 
Did you mean: 

Error in End routine

Former Member
0 Kudos

Hi All,

I have written mentioned code in End routine, but getting error. Please help.

read result_package assigning <result_Fields> where /BI0/OISOLD_TO = '0009100005'.
if sy-sub-rc = 0.
<result_fields>-amount = '149224'.
<result_fields>-currency = 'INR'.
Endif.

Accepted Solutions (0)

Answers (4)

Answers (4)

RafkeMagic
Active Contributor
0 Kudos

Iira Mishra Kesharwani wrote:

read result_package assigning <result_Fields> where /BI0/OISOLD_TO = '0009100005'.
if sy-sub-rc = 0.
<result_fields>-amount = '149224'.
<result_fields>-currency = 'INR'.
Endif.

I suggest you check the help on LOOP and READ.

You either LOOP ... WHERE or READ ... WITH KEY.

Former Member
0 Kudos

The logic worked but other values are comin wrong in Bex. Is there anyway I can hardcode values for particular cell in Bex. Can I acheive it through cell definition?

Former Member
0 Kudos

Maybe you can use cell definition, but is much more good practice to solve this in your datamodel.

Don't know exactly what you are trying to achieve but looks like you are willing to set an amount for a sold to party to a certain value and currency. Or should this be a total amount?

Question might be whether you get one or more records in the end routine for your 0sold_to_party '0009100005'.


Regards,

Marco

Loed
Active Contributor
0 Kudos

Hi Lira,

It should be sy-subrc NOT sy-sub-rc..Please check if error still occurs after changing the sy-subrc..

Try this:

Loop at  result_package assigning <result_Fields>  where /BI0/OISOLD_TO  '0009100005'.

if sy-subrc = 0.


<result_fields>-amount = '149224'.

<result_fields>-currency = 'INR'.


endif.


Endloop.




OR




As what you have written:


read result_package assigning <result_Fields> where /BI0/OISOLD_TO = '0009100005'.
if sy-subrc = 0.
<result_fields>-amount = '149224'.
<result_fields>-currency = 'INR'.
Endif.



I just changed the sy-subrc command..



Regards,

Loed

ccc_ccc
Active Contributor
0 Kudos

Hi Mishra,

You have write as like below.

loop at  result_package assigning <result_Fields>  where /BI0/OISOLD_TO  '0009100005'.

<result_fields>-amount = '149224'.

<result_fields>-currency = 'INR'.


Endloop.


That is pls check this.


Thank you,

Nanda