07-09-2008 5:58 PM
Hi all,
I need to create some Text Customer variables which can return the current month/year + 1, + 2, + 3... + 11. The format should looks like: Jul 08, Aug 08... Dec 08
I am writing a program which is calling two functions: 'RSCRMBW_MONTH' and 'MONTH_NAMES_GET'.
'RSCRMBW_MONTH' will return the month/year, for example: 07/2008, 08/2008...
'MONTH_NAMES_GET' should convert the month to Jul, Aug...
One thing I don't get is in the second function 'MONTH_NAMES_GET', there is a tab called Tables. It contain a parameter "MONTH_NAMES". Can anyone tell me how to pass this parameter from my program when I call this function?
Here is my program and I don't know how to write the second Call Function:
REPORT Z_TEST.
data: l_text type rstxtsh.
Data: l_code Type INT4.
clear l_text.
CALL FUNCTION 'RSCRMBW_MONTH'
EXPORTING
I_SHIFT = 1
I_DATE = SY-DATUM
I_DATFM = l_Format
IMPORTING
E_TEXT = l_text.
Call Function 'MONTH_NAMES_GET'
Exporting
LANGUAGE = 'E'
Importing
RETURN_CODE = l_code.
Write l_text.
Thanks for your advise!
07-09-2008 6:04 PM
Check this.
REPORT zrich_0001.
data: l_code type sy-subrc.
DATA: inames TYPE TABLE OF t247.
DATA: xnames LIKE LINE OF inames.
CALL FUNCTION 'MONTH_NAMES_GET'
EXPORTING
language = 'E'
IMPORTING
return_code = l_code
tables
month_names = inames.
* Read table by the month
READ TABLE inames INTO xnames WITH KEY mnr = sy-datum+4(2).
IF sy-subrc = 0.
WRITE:/ xnames-ltx.
ENDIF.
Regards,
Rich Heilman
07-09-2008 6:04 PM
Check this.
REPORT zrich_0001.
data: l_code type sy-subrc.
DATA: inames TYPE TABLE OF t247.
DATA: xnames LIKE LINE OF inames.
CALL FUNCTION 'MONTH_NAMES_GET'
EXPORTING
language = 'E'
IMPORTING
return_code = l_code
tables
month_names = inames.
* Read table by the month
READ TABLE inames INTO xnames WITH KEY mnr = sy-datum+4(2).
IF sy-subrc = 0.
WRITE:/ xnames-ltx.
ENDIF.
Regards,
Rich Heilman
07-09-2008 6:13 PM
07-09-2008 6:09 PM
Hi,
As Rich said, that Function module MONTH_NAMES_GET is not getting input as MONTH_NAMES.
This Function module is used to get the month names for the specified Language. So when you give Language to the
Function module it will list the Month names in that TABLE - MONTH_NAMES
Cheers
Kothand