‎2009 Sep 02 6:47 AM
Hi,
I am facing a strange situation in the below piece of code.
CLEAR:g_ltx, g_letter_dated, g_s_data-letter_dated.
SELECT SINGLE ltx FROM t247 INTO g_ltx
WHERE spras = 'EN' AND
mnr = g_month.
CONCATENATE g_date g_ltx g_year INTO g_letter_dated
SEPARATED BY space.
g_s_data-letter_dated = g_letter_dated.
Both g_s_data-letter_dated and g_letter_dated are charcater of 255 length.
The value '01 September 2009' of g_letter_dated is not getting assigned to g_s_data-letter_dated.
Can anybody tell me the reason and how to rectify it.
Thanks & Regards,
Soumya.
‎2009 Sep 02 6:52 AM
Hi,
Did you try with MOVE statement?
MOVE g_letter_dated to g_s_data-letter_dated.
Also g_s_data-letter_data is a field of a internal table. You amy have to use MODIFY or APPEND statement to make it reflect in the internal table.
Regards,
Vikranth
‎2009 Sep 02 6:57 AM
Hi Vikrant,
I tried MOVE statement also. That is also not working.
g_s_data is a work area.
Inorder to modify the internal table from the work area, the field g_s_data-letter_dated needs to be populated.
Thanks & Regards,
Soumya.
‎2009 Sep 02 7:12 AM
Hi Soumya,
Set a break point at the statement g_s_data-letter_dated = g_letter_dated, check in debugging mode and check if the values are populating at that instant. May be you are clearing the work area at a latter part
Regards,
Vikranth
‎2009 Sep 02 7:20 AM
Hi Vikrant,
I tried it in debugging mode and found that g_s_data-letter_dated is not populating,
The strange part is that if I put another statement like 'g_s_data-letter_dated = sy-datum.'
after the ' g_s_data-letter_dated = g_letter_dated.' , g_s_data-letter_dated is populated .
CONCATENATE g_date g_ltx g_year INTO g_letter_dated
SEPARATED BY space.
g_s_data-letter_dated = g_letter_dated. ---> Populated with 01 September 2009
g_s_data-letter_dated = sy-datum. ---> then Populated with sy-datum
Thanks & Regards,
Soumya.
‎2009 Sep 02 7:28 AM
try using
SHIFT LEFT G_letter_dated deleting leading spaces .
after ur concatenate statement.
‎2009 Sep 02 7:52 AM
>
> CONCATENATE g_date g_ltx g_year INTO g_letter_dated
> SEPARATED BY space.
> g_s_data-letter_dated = g_letter_dated. ---> Populated with 01 September 2009
> g_s_data-letter_dated = sy-datum. ---> then Populated with sy-datum
>.
Here you have stated that g_s_data-letter_dated = g_letter_dated is populated with 01 September 2009. Which means g_s_data-letter_dated holds the value.
Correct me if am wrong.
Regards,
Vikranth
‎2009 Sep 02 6:56 AM
Can we get the definitions of the variables like g_date, g_year etc also?
I defined the variable g_date as a two character variable and g_year as year and it worked fine for me.
‎2009 Sep 02 6:57 AM
My code is as below.
parameter: p_month LIKE t247-mnr.
DATA: g_ltx like t247-ltx,
g_letter_dated(255),
g_s_data-letter_dated(255),
g_date(2) value '01',
g_year(4) value '2009'.
CLEAR:g_ltx, g_letter_dated, g_s_data-letter_dated.
SELECT SINGLE ltx FROM t247 INTO g_ltx
WHERE spras = 'EN' AND
mnr = p_month.
CONCATENATE g_date g_ltx g_year INTO g_letter_dated
SEPARATED BY space.
g_s_data-letter_dated = g_letter_dated.
write:/ g_s_data-letter_dated.
‎2009 Sep 02 7:08 AM
My code is like this::
START-OF-SELECTION.
Populate pnpwerks based on MOLGA specified
PERFORM populate_pnpwerks.
g_mail = s_mail-low.
*Letter generated date.
g_year = sy-datum+0(4).
g_month = sy-datum+4(2).
g_date = sy-datum+6(2).
CLEAR:g_ltx, g_letter_dated, g_s_data-letter_dated.
SELECT SINGLE ltx FROM t247 INTO g_ltx
WHERE spras = 'EN' AND
mnr = g_month.
CONCATENATE g_date g_ltx g_year INTO g_letter_dated
SEPARATED BY space.
g_s_data-letter_dated = g_letter_dated.
GET pernr.
g_year, g_month and g_date are declared in a top include globally as:
DATA: g_year(4) TYPE c,
g_month(2) TYPE c,
g_date(2) TYPE c,
g_ltx TYPE t247-ltx,
g_letter_dated(255) TYPE c.
Regards,
Soumya.
‎2009 Sep 02 8:11 AM
Hi,
i'm getting the value of g_s_data-letter_dated in the code as put by you.
By the way, how is the g_s_data-letter_dated defined in your code ?
regds, Anoop