1. SPlit and Replace
SPLIT gv_tot_word1 AT 'Rupees' INTO lv_wrd lv_wrd1.
REPLACE ALL OCCURRENCES OF 'Rupees' IN lv_wrd WITH space.
REPLACE ALL OCCURRENCES OF 'Paise' IN lv_wrd1 WITH space.
2. To get word for given amount
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
amount = lv_amt_in_num
currency = gs_vbrk-waerk
filler = ' '
language = sy-langu
IMPORTING
in_words = in_words
EXCEPTIONS
not_found = 1
too_large = 2
OTHERS = 3.
CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
EXPORTING
amt_in_num = lv_amt_in_num
IMPORTING
amt_in_words = gv_tot_word1
EXCEPTIONS
data_type_mismatch = 1
OTHERS = 2.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
SPLIT gv_tot_word1 AT 'Rupees' INTO lv_wrd lv_wrd1.
REPLACE ALL OCCURRENCES OF 'Rupees' IN lv_wrd WITH space.
REPLACE ALL OCCURRENCES OF 'Paise' IN lv_wrd1 WITH space.
ENDIF.
3.Concatenate
CONCATENATE 'AND' lv_wrd1 dectext 'ONLY' INTO secondline SEPARATED BY ' '.
4. Condense and translate and move-corresponding
MOVE-CORRESPONDING gs_adrc_h TO gs_h_det.
CONDENSE gs_h_det-name1 ."NO-GAPS.
TRANSLATE gs_h_det-name1 TO UPPER CASE.
CONDENSE gs_h_det-bezei NO-GAPS .
5.Loop and concepts
DATA : lv_count TYPE i VALUE 0,lv_idx TYPE i.
LOOP AT gt_item INTO gs_item .
lv_idx = lv_idx + 1 .
MODIFY gt_item FROM gs_item INDEX lv_idx .
CLEAR : gs_item,lv_count .
ENDLOOP .
or
LOOP AT gt_item INTO gs_item WHERE ( kschl EQ 'ZPRD' OR kschl EQ 'ZPRA' ) AND flag <> 'X'.
lv_idx = SY-TABIX .
MODIFY gt_item FROM gs_item INDEX lv_idx TRANSPORTING kbetr_val amt .
CLEAR : gs_item , gs_item_temp .
ENDLOOP .
CLEAR : lv_idx.
6. To get Month name by passing period
CALL FUNCTION 'ISP_GET_MONTH_NAME'
EXPORTING
language = sy-langu
month_number = gs_vbrk-fkdat+4(2)
IMPORTING
longtext = gv_mon
EXCEPTIONS
calendar_id = 1
date_error = 2
not_found = 3
wrong_input = 4
OTHERS = 5.
7.To count no of records
DATA : lv_lines TYPE i.
DESCRIBE TABLE gt_bank[] LINES lv_lines .
SPLIT gv_tot_word1 AT 'Rupees' INTO lv_wrd lv_wrd1.
REPLACE ALL OCCURRENCES OF 'Rupees' IN lv_wrd WITH space.
REPLACE ALL OCCURRENCES OF 'Paise' IN lv_wrd1 WITH space.
2. To get word for given amount
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
amount = lv_amt_in_num
currency = gs_vbrk-waerk
filler = ' '
language = sy-langu
IMPORTING
in_words = in_words
EXCEPTIONS
not_found = 1
too_large = 2
OTHERS = 3.
CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
EXPORTING
amt_in_num = lv_amt_in_num
IMPORTING
amt_in_words = gv_tot_word1
EXCEPTIONS
data_type_mismatch = 1
OTHERS = 2.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
SPLIT gv_tot_word1 AT 'Rupees' INTO lv_wrd lv_wrd1.
REPLACE ALL OCCURRENCES OF 'Rupees' IN lv_wrd WITH space.
REPLACE ALL OCCURRENCES OF 'Paise' IN lv_wrd1 WITH space.
ENDIF.
3.Concatenate
CONCATENATE 'AND' lv_wrd1 dectext 'ONLY' INTO secondline SEPARATED BY ' '.
4. Condense and translate and move-corresponding
MOVE-CORRESPONDING gs_adrc_h TO gs_h_det.
CONDENSE gs_h_det-name1 ."NO-GAPS.
TRANSLATE gs_h_det-name1 TO UPPER CASE.
CONDENSE gs_h_det-bezei NO-GAPS .
5.Loop and concepts
DATA : lv_count TYPE i VALUE 0,lv_idx TYPE i.
LOOP AT gt_item INTO gs_item .
lv_idx = lv_idx + 1 .
MODIFY gt_item FROM gs_item INDEX lv_idx .
CLEAR : gs_item,lv_count .
ENDLOOP .
or
LOOP AT gt_item INTO gs_item WHERE ( kschl EQ 'ZPRD' OR kschl EQ 'ZPRA' ) AND flag <> 'X'.
lv_idx = SY-TABIX .
MODIFY gt_item FROM gs_item INDEX lv_idx TRANSPORTING kbetr_val amt .
CLEAR : gs_item , gs_item_temp .
ENDLOOP .
CLEAR : lv_idx.
6. To get Month name by passing period
CALL FUNCTION 'ISP_GET_MONTH_NAME'
EXPORTING
language = sy-langu
month_number = gs_vbrk-fkdat+4(2)
IMPORTING
longtext = gv_mon
EXCEPTIONS
calendar_id = 1
date_error = 2
not_found = 3
wrong_input = 4
OTHERS = 5.
7.To count no of records
DATA : lv_lines TYPE i.
DESCRIBE TABLE gt_bank[] LINES lv_lines .
No comments:
Post a Comment