on 12-11-2007 5:51 AM
Hii
i gt an requirement to display Total amt in words in the vendor debit note
i know the function module my question is call this function module
should i write any subroutine r should create zdriver prog
points will be rewarded
regards
Jaipal
Buddy
U can use subroutine also n Sample code for the same is given below...
PERFORM CDE_CENT IN PROGRAM ZKRPMM_PERFORM_Z1MEDRUCK
/:USING &EKKO-EBELN&
/:CHANGING &CDECENT&
/:ENDPERFORM
The report :
REPORT zkrpmm_perform_z1medruck .
DATA : BEGIN OF it_input_table OCCURS 10.
INCLUDE STRUCTURE itcsy.
DATA : END OF it_input_table.
déclaration de la table output_table contenant les
variables exportées
DATA : BEGIN OF it_output_table OCCURS 0.
INCLUDE STRUCTURE itcsy.
DATA : END OF it_output_table.
DATA : w_ebeln LIKE ekko-ebeln,
w_vbeln LIKE vbak-vbeln,
w_zcdffa LIKE vbak-zcdffa.
*----
FORM CDE_CENT
*----
FORM cde_cent TABLES input output.
it_input_table[] = input[].
it_output_table[] = output[].
READ TABLE it_input_table INDEX 1.
MOVE it_input_table-value TO w_ebeln.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = w_ebeln
IMPORTING
output = w_ebeln.
SELECT SINGLE zcdffa FROM ekko
INTO w_zcdffa
WHERE ebeln = w_ebeln.
it_output_table-name = 'CDECENT'.
MOVE w_zcdffa TO it_output_table-value.
MODIFY it_output_table INDEX 1.
output[] = it_output_table[].
ENDFORM.
Regards
Santosh L
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
SPLIT AMOUNT AT '.' INTO TOT_NUM TOT_DEC.
CONDENSE : TOT_NUM , TOT_DEC.
TOT_NUM_P = TOT_NUM.
TOT_DEC_P = TOT_DEC.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = TOT_NUM_P
LANGUAGE = SY-LANGU
IMPORTING
IN_WORDS = T_SPELL_NUM
EXCEPTIONS
NOT_FOUND = 1
TOO_LARGE = 2
OTHERS = 3
.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = TOT_DEC_P
LANGUAGE = SY-LANGU
IMPORTING
IN_WORDS = T_SPELL_DEC
EXCEPTIONS
NOT_FOUND = 1
TOO_LARGE = 2
OTHERS = 3
Hi Buddy
To get total amt in word we can do it wid subroutine also but i hav done same without using subroutine and followin are the code for the same
code in z report
*data Declaration==============================================
DATA: TOT_NUM_P TYPE CHAR20,
AMOUNT TYPE CHAR20,
TOT_DEC_P TYPE CHAR20,
T_SPELL_NUM TYPE SPELL,
T_SPELL_DEC TYPE SPELL,
TOT_NUM(25) TYPE c,
TOT_DEC(25) TYPE c,
ONE(80) TYPE C,
TWO(80) TYPE C,
STR(120) TYPE C,
RUPE(7) TYPE C,
DECM(11) TYPE C,
PAISE(15) TYPE C.
DATA: TOT_NUM_P1 TYPE CHAR20,
TOT TYPE CHAR20,
TOT_DEC_P1 TYPE CHAR20,
T_SPELL_NUM1 TYPE SPELL,
T_SPELL_DEC1 TYPE SPELL,
TOT_NUM1(25) TYPE c,
TOT_DEC1(25) TYPE c,
ONE1(80) TYPE C,
TWO1(80) TYPE C,
STR1(120) TYPE C.
SPLIT AMOUNT AT '.' INTO TOT_NUM TOT_DEC.
CONDENSE : TOT_NUM , TOT_DEC.
TOT_NUM_P = TOT_NUM.
TOT_DEC_P = TOT_DEC.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = TOT_NUM_P
LANGUAGE = SY-LANGU
IMPORTING
IN_WORDS = T_SPELL_NUM
EXCEPTIONS
NOT_FOUND = 1
TOO_LARGE = 2
OTHERS = 3
.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = TOT_DEC_P
LANGUAGE = SY-LANGU
IMPORTING
IN_WORDS = T_SPELL_DEC
EXCEPTIONS
NOT_FOUND = 1
TOO_LARGE = 2
OTHERS = 3
.
ONE = T_SPELL_NUM-WORD.
TWO = T_SPELL_DEC-WORD.
DECM = 'AND'.
RUPE = IT_HEADER-WAERK.
PAISE = 'PAISE ONLY'.
CONCATENATE ONE DECM TWO PAISE INTO STR SEPARATED BY SPACE.
SPLIT TOT AT '.' INTO TOT_NUM1 TOT_DEC1.
CONDENSE : TOT_NUM1 , TOT_DEC1.
TOT_NUM_P1 = TOT_NUM1.
TOT_DEC_P1 = TOT_DEC1.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = TOT_NUM_P1
LANGUAGE = SY-LANGU
IMPORTING
IN_WORDS = T_SPELL_NUM1
EXCEPTIONS
NOT_FOUND = 1
TOO_LARGE = 2
OTHERS = 3
.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = TOT_DEC_P1
LANGUAGE = SY-LANGU
IMPORTING
IN_WORDS = T_SPELL_DEC1
EXCEPTIONS
NOT_FOUND = 1
TOO_LARGE = 2
OTHERS = 3
.
ONE1 = T_SPELL_NUM1-WORD.
TWO1 = T_SPELL_DEC1-WORD.
DECM = 'AND'.
RUPE = IT_HEADER-WAERK.
PAISE = 'PAISE ONLY'.
CONCATENATE ONE1 DECM TWO1 PAISE INTO STR1 SEPARATED BY SPACE.
code in Sapscript text edotor
,,&STR&
,,&STR1&
hope this will solve ur query...
Regards
Santosh L
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi
u have to create subroutine for this function module.
and call that sub routine in script using following syntax:
PERFORM < routine_name> in <report_name>
USING &var1&
CHANGING &var2&.
ENDPERFORM.
Rewards points if useful.
Thanks,
Usha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.