08-30-2007 1:48 PM
hi guys this the program iam using
data : date(10),
text1(26),
num1(10),
test_day(15),
idate type sy-datum.
data : Day(2), month(2), Year(4).
data : ODay(2), Omonth(2), OYear(4).
data : Ltext Type T247-LTX.
date = order_date.
day = date+0(2).
month = date+4(2).
year = date+6(4).
concatenate year month day into idate.
CALL FUNCTION 'HR_IN_GET_DATE_COMPONENTS'
EXPORTING
idate = idate
IMPORTING
DAY = oday
MONTH = omonth
YEAR = oyear.
LTEXT = ltext.
concatenate oday ltext oyear into p_date.
in the smartform my date is in the field order_date when ima excuting iam getting a runtime error sayin <text for month not maintained>
advise..
regds
08-30-2007 3:12 PM
Assuming your variable order_date is type DATE you don't need any of this,
date = order_date.
day = date+0(2).
month = date+4(2).
year = date+6(4).
concatenate year month day into idate.
All you're doing is rearranging the date into a format meaningless to the function module.
CALL FUNCTION 'HR_IN_GET_DATE_COMPONENTS'
EXPORTING
idate = order_date
IMPORTING
DAY = oday
MONTH = omonth
YEAR = oyear.
LTEXT = ltext.
should be enough.
Regards,
Nick
08-30-2007 3:49 PM
hi nick thanks for your reply..but when i use that code i get the exception date is initial..
regards
08-30-2007 4:06 PM
So there is your problem, order_date is initial. By passing order_date through date and into idate only fills idate with a different kind of nothing.
You need to ensure order_date is filled with an actual date value, either from the calling program or by derivation in your form.
Regards,
Nick
08-30-2007 4:35 PM
well.....can you please tell me how can i do that..
when i print normal date format which is in the field on the text element i can see the date...
the same thing when iam writing on programming lines iam getting exceptions..
plz help me how to that...
cheers..
08-30-2007 5:16 PM
Hi Sudheer,
Why dont you try the date mask??
/: SET DATE MASK = 'DDth of MMM YYYY'
It will show the date as 30th of AUG 2007.
Thanks and Best Regards,
Vikas Bittera.
**Reward if useful**
08-30-2007 5:22 PM
u cant use setdate mask in smartforms...
i think...
thank you anyways
08-30-2007 5:39 PM
Hello Sudheer,
issue would be T247 Table, month text is not maintained.
Just goto Sm30 Transaction -> enter table T247 -> click on display.
if you want to insert then you can insert,system will propmt transport request.
Thanks
Seshu
08-30-2007 5:43 PM
08-30-2007 5:54 PM
Can you not check
IF order_date IS NOT INITIAL.
-
do all your logic
ELSE.
--- check with your user/functional team member as to what needs to be done
ENDIF.
08-31-2007 7:32 AM
Do you have your field order_date defined as an INPUT parameter of you program node?
Regards,
Nick
08-31-2007 11:11 AM
yes nick.. another thing is when i use the field name as it is in text elements i can see the date on form..when i am changing the format and using this field in program lines the order_date is initial..
advise
regds
08-31-2007 11:46 AM
Hi,
I'm running out of ideas.
Is the value in ORDER_DATE passed in the form interface, or is it declared in global data and derived (in program lines)?
Is your text element where this value can be displayed at the same point in the form as your program lines to reformat it?
Regards,
Nick
08-31-2007 11:57 AM
lol..soory to bother you mate..
i passed the whole table in forminterface and iam using loop at tab_orders into tab_orders which is my internal table..
and i also declared this order_date in global declaration
yes my text element is at the same point..
>>programlines
>>>textement
regards
08-31-2007 12:07 PM
Bingo! (I think)
So, TAB_ORDERS (which includes the field ORDER_DATE) comes into your form.
You loop through TAB_ORDERS in a table node (you really should declare a work area for this table WA_TAB_ORDERS, not use tab_orders again).
Inside your table node create a program node, pass WA_TAB_ORDERS in the input parameters and p_date as the output.
Call this code,
CALL FUNCTION 'HR_IN_GET_DATE_COMPONENTS'
EXPORTING
idate = WA_TAB_ORDERS-order_date
IMPORTING
DAY = oday
MONTH = omonth
YEAR = oyear.
LTEXT = ltext.
concatenate oday ltext oyear into p_date.
After this, use P_DATE in your text element.
I think this is it. It may help to delete the definition of the global field order_date, this is what your current code is using, but it never gets filled.
Regards,
Nick
08-31-2007 12:32 PM
Nick sorry mate...
same result whatever i do...i dont know how to get through this...
anyway thanks for your help...
regds,
08-31-2007 12:54 PM
Ok, one last try. Can you extract your form as xml (initial smartforms screen, Utilities -> download form) and mail it to nick1971young@yahoo.co.uk
This really should work. We've come too far to give up now!
Regards,
Nick
08-31-2007 1:09 PM
hi nick,
you want the output of my form what iam gettin now...just to make clear..
regards
08-31-2007 1:13 PM
No, the definition of the form. Call transaction SMARTFORMS, enter your form name and choose menu Utilities -> download form. This creates a file on your PC, send me this.
08-31-2007 1:16 PM
08-31-2007 1:19 PM
You must be on a 4.6C system, this option wasn't available until 4.7
Oh well, sorry I can't help any more. Looks like this is the one that got away.
Regards,
Nick
08-31-2007 1:21 PM
thanks for your help mate...
may be iam doin smthing wrong smwhere...lets see
regds