Skip to Content
avatar image
Former Member

SAP Script: Passing internal table to subroutine - Difference between Head value and Table contents

Hallo expert!

Status: just after DB Conversion from oracle to HANA

I am working on SAP script and I made a subroutine for that as following.

-------------------------------------------------------------------------------

PERFORM SALDO_EVALUATE IN PROGRAM ZIMWADR0

USING &RF140-SALDO&

CHANGING &LV_SALDO& ENDPERFORM

-----------------------------------------------------------------------------

It didn't work good. So I debugged it.

When i was debuggin it, I found very interested thing.

----------------------------------------------------------------------------

FORM saldo_evaluate

TABLES itab STRUCTURE itcsy
otab STRUCTURE itcsy.

-----------------------------------------------------------------------------

I used otab as output table. and its head value was filled with not LV_SALDO but lV_TEXT which is a different local variable in same SAP Script and was used for another subroutine just before. and its content was filled with LV_SALDO.

exactly to saying:

otab( head value): LV_TEXT Text 3

otab[] (Table contents): LV_SALDO

Therefore table otab has different value in head value and in contents.

I checked these values just after subroutine just called.

I didn't see such a thing ever. If you have any idea, could please help me to find out the reason of this situation and solution, please?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Oct 13, 2017 at 06:56 PM

    I'm guessing you need to clear the unwanted variable from the header then? Not sure what is the predicament exactly... There are very many posts online explaining how the SAPscript subroutines work, this blog is just from the top of the Google search.

    But this day and age I'd really suggest to start replacing SAPScripts with PDF forms or at least Smartforms. SAPScript won't be supported in S/4HANA (thankfully).

    Add comment
    10|10000 characters needed characters exceeded