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: 

Production Code Working abnormally

0 Kudos

Hi Team,

In our Client, we have developed a program in RE-FX Module. We have tested it different cases in qualty system and found that everything is fine.

Now, The issue is program working abnormally some times,

IF zrem_ss_revenue-per_post IS NOT INITIAL.
SELECT belnr bschl hkont dmbtr FROM bseg INTO CORRESPONDING FIELDS OF TABLE it_bseg
WHERE bukrs = zrem_ss_revenue-per_post_bukrs
AND belnr = zrem_ss_revenue-per_post
AND gjahr = zrem_ss_revenue-per_post_year.
IF sy-subrc EQ 0.
CLEAR: lv_tax, lv_hecess, lv_secess.
LOOP AT it_bseg INTO wa_bseg .
IF wa_bseg-hkont = '0022021101'. "Total Tax
lv_tax = lv_tax + wa_bseg-dmbtr.
ELSEIF wa_bseg-hkont = '0022021102'. "Total SEcess
lv_secess = lv_secess + wa_bseg-dmbtr.
ELSEIF wa_bseg-hkont = '0022021103'. "Total HEcess
lv_hecess = lv_hecess + wa_bseg-dmbtr.
ELSEIF wa_bseg-hkont = '0022021104'. "Total SBcess
lv_sbcess = lv_sbcess + wa_bseg-dmbtr.
ELSEIF wa_bseg-hkont = '0022021105'.
lv_kkcess = lv_kkcess + wa_bseg-dmbtr.
ENDIF.
ENDLOOP.

ENDIF.

The above code is working fine but some times it is giving wrong values. We have tried to put debugger, then no issue raises. The issue came only when it is executed without debugging and some times only.

Request you to help me in this if any one face the above issue.

Thanks in Advance.

Thanks,

Saikrishna.

2 REPLIES 2

raymond_giuseppi
Active Contributor

With the posted information I can only guess that some FI document is not yet commited to database, or database/server buffer aren't up to date.

You should provide more information, e.g. when and where this code is implemented, etc.

0 Kudos

Hi Raymond,

Thanks for your reply.

The document is posted in RE- FX Module. When ever user done the periodic postings in the contract, a fi document is posted and at that same time we are sending an acknowledgement that document is posted to non sap system through PI(automatic process).

Now My problem is in that acknowledgement, it contains wrong values some time (code is given above).