cancel
Showing results for 
Search instead for 
Did you mean: 

not getting value in script

Former Member
0 Kudos

Hello Experts,

I want to print sum of credit balance and debit balance in script.

I am getting correct values in program even in OUT_TAB.

like

BSEG-WRBTR = 30000
            BSEG-DMBTR = -63000

I used perform endperform in script like

PERFORM ZSSC_FI_01_BAL IN PROGRAM ZRFKORK00
USING &BSEG-BUKRS&
USING &BSEG-KOART&
USING &DKADR-KONTO&
CHANGING &BSEG-WRBTR&
CHANGING &BSEG-DMBTR&
ENDPERFORM

But when i see print preview

I am getting

Debit bal: -63000

Credit bal: -63000

Can anyone plz help me .

Thanks & regards,

Manisha

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

check the modify statements in your external perform, i sense you stored same value in both changing parameters.

Former Member
0 Kudos

Dear Florian,

Thanks for your reply.

But i hv written like

READ TABLE OUT_TAB INDEX 1.
  IF SY-SUBRC = 0.
    OUT_TAB-VALUE = SUM_DEBIT.
    MODIFY OUT_TAB INDEX 1.
  ENDIF.

  READ TABLE OUT_TAB INDEX 2.
  IF SY-SUBRC = 0.
    OUT_TAB-VALUE = SUM_CREDIT.
    MODIFY OUT_TAB INDEX 2.
  ENDIF.

Manisha

Edited by: PATIL MANISHA on Jul 30, 2010 11:05 AM

arul_murugan
Active Participant
0 Kudos

Hi,

Check the output table of the two fields in the perform. Otherwise the problem will be while declaring in the sap script after the perform statement

Debit bal: &BSEG-WRBTR&

credti bal: &BSEG-DMBTR&

check out the OUT_TAB-FIELD while passing the values based on the index.

Thanks

Arul

Edited by: Arul on Jul 30, 2010 2:41 PM

Former Member
0 Kudos

ahhh get rid of those INDEX 1 things. thats not a good programming style and very error forcing when maintained.

it works like:


  READ TABLE out_tab
  WITH KEY name = 'BSEG-WRBTR'.
  IF sy-subrc = 0.
    out_tab-value = lv_lgort.
    MODIFY out_tab INDEX sy-tabix.
  ENDIF.

  READ TABLE out_tab
  WITH KEY name = 'BSEG-DMBTR'.
  IF sy-subrc = 0.
    out_tab-value = lv_lgort.
    MODIFY out_tab INDEX sy-tabix.
  ENDIF.

well forget about that lv_lgort, i copied that from one of my developments and forgot to change it everywhere.

Edited by: Florian Kemmer on Jul 30, 2010 11:21 AM

Former Member
0 Kudos

Dear Arul n Florian,

Thanks a lot for reply.

As Arul said, i just forgot to change &BSEG-WRBTR&.

n

I will keep in mind the tip given by Florian.

My problem is solved...........

Thanks friends!!!

Manisha

Answers (0)