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: 

Modifications on SAP Standard script data not displayed

0 Kudos
608

Hi,

   I am facing problem on  SAP STANDARD SCRIPT .My requirement is  We can do some changes in in Purchase Order form   " MEDRUCK  "

   In standard the currency is not printing in terms of word so my requirement is i have to show the currency in words.

i am fallowing these steps:

1.Copying the MEDRUCK   to     zpo_MEDRUCK

2. After changing some changes in  ZPO_MEDRUCK

3. Through  NACE transaction i assigned to  Required program

These are changes in my form

In SE38 i am writing this code

DATA:LV_WAERS TYPE WAERS,
      LS_WORDS TYPE SPELL.
FORM F_AMOUNT_WORDS TABLES INPUT STRUCTURE ITCSY
                           OUTPUT STRUCTURE ITCSY  .

   DATA:LV_WAERS TYPE WAERS.

   READ TABLE INPUT WITH KEY NAME = 'EKKO-WAERS'.
   IF SY-SUBRC = 0.
     LV_WAERS = INPUT-VALUE.
   ENDIF.

   READ TABLE INPUT WITH KEY NAME = 'KOMK-FKWRT'.
   IF SY-SUBRC = 0.
     CALL FUNCTION 'SPELL_AMOUNT'
       EXPORTING
         AMOUNT    = INPUT-VALUE
         CURRENCY  = LV_WAERS
*       FILLER    = ' '
*       LANGUAGE  = SY-LANGU
       IMPORTING
         IN_WORDS  = LS_WORDS
       EXCEPTIONS
         NOT_FOUND = 1
         TOO_LARGE = 2
         OTHERS    = 3.
     READ TABLE OUTPUT WITH KEY NAME = 'LV_WORDS'.
     IF SY-SUBRC = 0.
       OUTPUT-VALUE = LS_WORDS-WORD.
       MODIFY OUTPUT INDEX SY-TABIX.
     ENDIF.
   ENDIF.
*
ENDFORM.



--->after assigning the modified form to Standard program my logic is not trigger only Converting currency to word format ..remaining changes will be updated


1 ACCEPTED SOLUTION

prajeshdesai
Contributor
0 Kudos
492

Try to use /= (executable lines),

/= Amount in words : &LV_WORDS&

Hope this helps.

12 REPLIES 12

prajeshdesai
Contributor
0 Kudos
493

Try to use /= (executable lines),

/= Amount in words : &LV_WORDS&

Hope this helps.

0 Kudos
492

Hi Prajesh,

      It is also not working

0 Kudos
492

Did you try to debug that FORM? Because it's worked for me.

If possible share your output.

0 Kudos
492

Hi Prajesh,

  i am trying but data is not displaying still i am checking my code where i did the mistake

These are step i am fallowing :

1. Copying the standard form to custom   {  MEDRUCK  ----- > ZPO_MEDRUCK }

2. Language conversion   { DE ---------- > EN }

3.Adding logo on specific location on form

4.Define the subroutine in required location means where i can display the data

             this is my subroutine code

            

5. I can assign the form to Standard program {  NACE  t.code  }

     In   SE38   creating the subroutine Pool program

6.Next we are cheking t.code     ME23N

            PO    :    4500015958

   in print preview mode   my logo will be displayed   but the   this text is not displaying   " The amount in words   "  this text also not printing

Let me know where i did mistake

0 Kudos
492

I hope you tired the suggestion i gives you earlier. you are using /:, i told you /=

/=       Amount in words : &LV_WORDS&

if still not working try,


TO      Amount in words : &LV_WORDS&

Save and Activate.

0 Kudos
492

I am trying Both the options still it is not displaying data only logo is displaying

0 Kudos
492

One more point is, SAP SCRIPT is client dependent, so you are doing testing in a same client, in which you done those changes, right?

if not use report RSTXR3TR to transport your script from one client to another.

0 Kudos
492

Hi Prajesh,

       Now its working. I have one more doubt i am Testing different PO Numbers some PO numbers My changes are updated some PO numbers my form not Updated

                  PO Numbers  :   4500017230  ,  4500017225    

                 PO Numbers  :   4500008101  ,   4500008309 ,  4500008500

0 Kudos
492

Strange, i think the way to come from this is DEBUG.

Steps to debug sap script:


1. Execute RSTXDBUG reprot in SE38

OR

2. SE71 -> Utility -> Activate Debugger 

Check your change is reflected in debug or is there some condition which is by pass your changes or is there some other script is calling for different inputs.

Debug all scenarios will help you. 

sas3
Explorer
0 Kudos
492

Hi Praveen,

For writing the Perform logic in ABAP Editor, are you using executable program or subroutine pool program?

0 Kudos
492

Hi,

subroutine pool Program.

0 Kudos
492

Hi Praveen,

Please follow below sample code which is used for amount in words for invoive(VF03).

REPORT  ZINV_SUBROUTINE1.

DATA:   result TYPE STRING ,

              gv_amt TYPE spell.


DATA : full_in_words type string.


FORM GET_AMT TABLES IN_PAR STRUCTURE ITCSY
                                                OUT_PAR STRUCTURE ITCSY.


  READ TABLE IN_PAR WITH KEY name = 'KOMK-FKWRT'.

*replace ALL OCCURRENCES OF ',' in in_par-value WITH ''.
*CONDENSE in_par-value NO-GAPS.
if sy-subrc is INITIAL.
result = in_par-value.
endif.

* ***----USE FM SPELL_AMOUNT and take ammount in words in gv_amt


CALL FUNCTION 'SPELL_AMOUNT'
  EXPORTING
*   AMOUNT          = 'KOMK-FKWRT'
    AMOUNT          = result                             

CURRENCY        = ' INR'
*   FILLER          = ' '
   LANGUAGE        = SY-LANGU
  IMPORTING
    IN_WORDS        = gv_amt
EXCEPTIONS
   NOT_FOUND       = 1
   TOO_LARGE       = 2
   OTHERS          = 3.

IF SY-SUBRC EQ 0.
CONCATENATE gv_amt-WORD 'or' gv_amt-decword
INTO full_in_words
SEPARATED BY space.
ENDIF.

OUT_PAR-NAME = 'full_in_words'.
OUT_PAR-VALUE = full_in_words.                                   


*MOVE full_in_words TO OUT_PAR-VALUE.
MODIFY OUT_PAR INDEX SY-TABIX.

  ENDFORM.

 

For SAPscript:

Our Code in SAPscript:


SU      Final amount,,,,,,,,,,,,,,,,&KOMK-FKWRT(I13)&                (KOMK-FKWRT GIVES TOTAL VALUE)

/:         DEFINE &FULL_IN_WORDS& = ''

/:         PERFORM GET_AMT IN PROGRAM ZINV_SUBROUTINE1

/:         USING &KOMK-FKWRT&

/:         CHANGING &FULL_IN_WORDS&

/:         ENDPERFORM

SU        AMOUNT IN WORDS,,&full_in_words&

Thanks &Regards,

Raju Rapelli