Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

exception:text for month not maintained

Former Member
0 Kudos
772

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

21 REPLIES 21
Read only

Former Member
0 Kudos
668

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

Read only

0 Kudos
668

hi nick thanks for your reply..but when i use that code i get the exception date is initial..

regards

Read only

0 Kudos
668

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

Read only

0 Kudos
668

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..

Read only

0 Kudos
668

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**

Read only

0 Kudos
668

u cant use setdate mask in smartforms...

i think...

thank you anyways

Read only

0 Kudos
668

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

Read only

0 Kudos
668

it is displayed...nothin wrong with t247 table

thanks

Read only

0 Kudos
668

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.

Read only

0 Kudos
668

Do you have your field order_date defined as an INPUT parameter of you program node?

Regards,

Nick

Read only

0 Kudos
668

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

Read only

0 Kudos
668

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

Read only

0 Kudos
668

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

Read only

0 Kudos
668

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

Read only

0 Kudos
668

Nick sorry mate...

same result whatever i do...i dont know how to get through this...

anyway thanks for your help...

regds,

Read only

0 Kudos
668

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

Read only

0 Kudos
668

hi nick,

you want the output of my form what iam gettin now...just to make clear..

regards

Read only

0 Kudos
668

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.

Read only

0 Kudos
668

i cant see any download in the utilities..

Read only

0 Kudos
668

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

Read only

0 Kudos
668

thanks for your help mate...

may be iam doin smthing wrong smwhere...lets see

regds