‎2005 Jul 22 6:51 AM
in function module i call the program using "submit" command, the syntax is:
submit ZSD_RG1_REG exporting list to memory
with WERKS = WERKS
with BUDAT-LOW = BUDAT_LOW
with BUDAT-HIGH = BUDAT_HIGH
with MATERIAL-LOW = MATERIAL_LOW
with MATERIAL-HIGH = MATERIAL_HIGH
and return.
i enter the values in FM for the fields in following ways werks = 1810 material_low = fet000075 and budat_low = 02.04.2005
now the result i get is selection-screen of the report where all the fields are filled except for the budat-low field which is showing blank.
Whereas i should'nt get the selection-screen of the report itself. What could be the error pls help me.
‎2005 Jul 22 6:58 AM
Hi Deepak,
Have you tried using budat_low = '20050402' ?
Regards,
Anand Mandalika.
‎2005 Jul 22 6:58 AM
Hi Deepak,
Have you tried using budat_low = '20050402' ?
Regards,
Anand Mandalika.
‎2005 Jul 22 7:06 AM
ya i have tried using it
but it is accepting as 20.05.0402 if i enter '20050402'
‎2005 Jul 22 7:10 AM
Hi,
what is the dictionary element of your budat? Internal date format is <i>always</i> YYYYMMDD, only external display depends on user settings.
-> Inside programs use '20050402' - and why is your conversion into an external format not working?
Regards,
Christian
‎2005 Jul 22 7:42 AM
Hi Deepak,
1. The field BUDAT_LOW should be of type D. Have yo declared it with a character type ?
2. The date field is always of 8 characters. The separators come into picture only when the data is being displayed / printed.
3. All program variables which store the date should be declared with type D. And the data should always be given as 'YYYYMMDD' in the program. The date separator is a customizable setting and therefore can can be different for different users, based on their choice.
Regards,
Anand Mandalika.
‎2005 Jul 22 11:40 AM
Thank you guys
all of you have been very helpful.
but in reality my problem is :
submit ZRPT_SD_027 exporting list to memory
with WERKS = WERKS
with BUDAT-LOW = BUDAT_HIGH
WITH BUDAT-HIGH = BUDAT_HIGH
WITH MATNR-LOW = MATERIAL-LOW
WITH MATNR-HIGH = MATERIAL_HIGH
with KUNNR-LOW = KUNNR_LOW
with KUNNR-HIGH = KUNNR_HIGH
WITH P_VARI = P_VARIS
and return.
If you look into above code:
i have declared all the left hand side part i.e. after "WITH" in my selection-screen and all the Right hand side part i.e. after "=" (eg BUDAT_LOW) in "IMPORT" parameter of the function module. You see some of the fields in the select-options may be optional (like KUNNR-HIGH OR MATNR-HIGH) so even in function module i wont enter any values for those fields which are optional. But even then while executin either it takes me to the selection-screen or gives an exception NOT_FOUND which it encounters in list_from_memory (following FM).
can you pls help me with this
‎2005 Jul 22 7:25 AM
why do you use with BUDAT-LOW = BUDAT_LOW
and not with "BUDAT in S_BUDAT" ?
regards Andreas
‎2005 Jul 22 7:26 AM
Hi Deepak,
Pass the value as extenal date type, and when using the date
convert it into internal date type using CONVERT_DATE_TO_INTERNAL.
For the vice versa try CONVERT_DATE_TO_EXTERNAL.
Cheers
Kathir~
‎2005 Jul 22 7:33 AM
wouldn't it be much easier to link budat to dictionary and let do the system make the external conversions completly automatically?
‎2005 Jul 22 7:46 AM
there is a function module that can get the user setting for the date format for you and then u can use another function module to convert the date to the desired format....
these FMs are...
SLS_MISC_GET_USER_DATE_FORMAT - to get user's date format
SLS_MISC_CONVERT_TO_DATE - to convert date to desired
format
just see if u can help yourself with these....
regards,
PJ
‎2005 Jul 22 7:55 AM
Hi Kathir~, PJ,
nice when you know all these functions to hanlde dates - but this can be done by system without any notice of user / programmer!
Just follow the way Anand Mandalika described detailed and you never need all these functions.
Sorry Deepak - here are two different solutions described by four persons - I hope we don't confuse you.
Regards,
Christian
‎2005 Jul 22 2:41 PM
Deepak,
Try this code.
RANGES R_BUDAT FOR SY-DATUM.
DATA: BUDAT_LOW TYPE D,
BUDAT_HIGH TYPE D.
BUDAT_LOW = '20050101'.
BUDAT_HIGH = '20050131'.
R_BUDAT-SIGN = 'I'.
R_BUDAT-OPTION = 'BT'.
R_BUDAT-LOW = BUDAT_LOW.
R_BUDAT-HIGH = BUDAT_HIGH.
APPEND R_BUDAT.
SUBMIT ZSD_RG1_REG
exporting list to memory
WITH BUDAT IN R_BUDAT
AND RETURN.
~Sivaraj.