10-06-2008 6:57 PM
HI all,
I have decalred a variable mard-LABST
Data: v_labst type mard-lasbst.
But when i check syntactical check it was showing syntactically wrong.
can any body please tell me how to decalre.
10-06-2008 6:59 PM
10-06-2008 7:00 PM
10-06-2008 7:06 PM
10-06-2008 7:10 PM
Try to check the code around the line of syntax error to see if you missed any periods..
data: v_labst type mard-labst should work.
10-06-2008 7:14 PM
Hi all,
This is my code. can you please check in u r editors.
tables: mard.
Types: begin of ty_NTGEW,
Matnr type matnr,
labst type labst,
lgort type LGORT_D,
end of ty_NTGEW.
data: v_ntgew type standard table of ty_ntgew,
wa_ntgew type ty_ntgew.
data: v_ntgew1 type standard table of ty_ntgew,
wa_ntgew1 type ty_ntgew,
v_open like wa_ntgew.
data: v_test type mard-labst.
Select MATNR
labst
lgort
From MARd up to 10 rows
Into corresponding fields of table V_NTGEW
where labst NE '0.000'.
loop at v_ntgew into wa_ntgew.
v_open = wa_ntgew.
move v_open-labst to v_test.
Replace all occurrences of '-' in v_test with ''.
Replace all occurrences of CL_ABAP_CHAR_UTILITIES=>CR_LF in V_test with ''.
write:/ v_test.
move v_test to v_open-labst.
write:/ v_open-labst.
endloop.
10-06-2008 7:14 PM
Data: v_labst type mard-lasbst. "it is wrong
because in mard there is no field with lasbst.
Data: v_labst type mard-labst. "correct
10-06-2008 7:17 PM
DATA: v_test TYPE mard-labst.
DATA: lv_test(18). "char field
SELECT matnr
labst
lgort
FROM mard UP TO 10 ROWS
INTO CORRESPONDING FIELDS OF TABLE v_ntgew
WHERE labst NE '0.000'.
LOOP AT v_ntgew INTO wa_ntgew.
v_open = wa_ntgew.
MOVE v_open-labst TO v_test.
WRITE v_test TO lv_test.
"error is from qty field
REPLACE ALL OCCURRENCES OF '-' IN lv_test WITH ''.
REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>cr_lf IN lv_test WITH
''.
WRITE:/ v_test.
MOVE v_test TO v_open-labst.
WRITE:/ v_open-labst.
ENDLOOP.
10-06-2008 7:18 PM
HI vijay,
Sorry i have typed here wrong . But in my pgm i have typed correct.
Can you please check my above pgm.
10-06-2008 7:05 PM
10-06-2008 7:18 PM
You have an structure of type ty_mard and while declaring an internal table you can declare it as
data: t_mard type table of ty_mard,
wa_mard like line of t_mard.
There is no problem with the declaration of the variable v_open.
10-06-2008 7:19 PM
Hi,
Try this..
Declare V_TEST as string...In the replace statement the V_TEST should be given as a character data type.
data: v_test type string.
Thanks
Naren
10-06-2008 8:25 PM
MARD-LABST is a quantity field. You can not use REPLACE on a quantity field (and there wouldn't be any '-' in there anyways).
11-10-2008 2:34 PM