‎2005 Feb 17 12:42 PM
Hi,
I want to fill an internal table (2 fields) and a constat value ('CONFIRMED') to every line.
Below gives me an error.
Any pointers ?
select
X_EKKO~EBELN
'CONFIRMED'
from EKKO as X_EKKO
inner join LFA1 as X_LFA1 on X_LFA1LIFNR = X_EKKOLIFNR
inner join EKPO as X_EKPO on X_EKPOEBELN = X_EKKOEBELN
inner join EKES as X_EKES on X_EKESEBELN = X_EKPOEBELN AND X_EKESEBELP = X_EKPOEBELP
into table i_MasterDataConf
where
(where_clause)
AND X_EKES~EINDT > l_enddate2.
//Martin
‎2005 Feb 17 1:02 PM
Hello Martin,
You cannot use the literal 'CONFIRMED' in the SELECT statement !! The SELECT statement allows you to only <i>select</i> the data <i>from the database</i>.
In your code, use the addition INTO CORRESPONDING FIELDS OF i_MasterDataConf.
Then fill the internal table with the value 'CONFIRMED' in the second field of all rows using the statement
MODIFY ITAB FROM ITAB TRANSPORTING <NAME OF THE SECOND FIELD> WHERE <SECOND FIELD> EQ SPACE.
Regards,
Anand Mandalika.
‎2005 Feb 17 12:52 PM
Hello,
First of all you can select all the data from the transparent table into IntTab.
Then you can fill the constant value by LOOP ... MODIFY InTab. ... ENDLOOP.
Regards, Murugesh AS
‎2005 Feb 17 1:02 PM
Hello Martin,
You cannot use the literal 'CONFIRMED' in the SELECT statement !! The SELECT statement allows you to only <i>select</i> the data <i>from the database</i>.
In your code, use the addition INTO CORRESPONDING FIELDS OF i_MasterDataConf.
Then fill the internal table with the value 'CONFIRMED' in the second field of all rows using the statement
MODIFY ITAB FROM ITAB TRANSPORTING <NAME OF THE SECOND FIELD> WHERE <SECOND FIELD> EQ SPACE.
Regards,
Anand Mandalika.
‎2005 Feb 17 1:21 PM
I read the help section but did not understand the Mass Update stuff:
I tried:
MODIFY i_MasterDataConf FROM i_MasterDataConf TRANSPORTING 'CONFIRMED' WHERE X_STATUS EQ SPACE.
//Martin
‎2005 Feb 17 1:26 PM
I assume a particular <b>field</b> of the internal table i_masterdataconf should have the <b>value</b> 'CONFIRMED'.
So code can be :
i_masterdataconf-<i>fieldname</i> = '<b>CONFIRMED</b>'.
MODIFY i_MasterDataConf FROM i_MasterDataConf TRANSPORTING <i>fieldname</i> WHERE X_STATUS EQ SPACE.
if sy-subrc <> 0.
endif.
Regards,
Subramanian V.
‎2005 Feb 17 1:37 PM
oppss... I'm inside BSP. Sorry.
Maybe we can solve this anyway.
Type Def:
types: begin of t_MasterDataStruct,
X_EKKO_EBELN type EKKO-EBELN,
X_STATUS type string,
end of t_MasterDataStruct.
types: tt_MasterDataStruct type table of t_MasterDataStruct.
"i_MasterDataConf is of the type tt_MasterDataStruct"
i_MasterDataConf-X_STATUS = 'CONFIRMED'.
MODIFY i_MasterDataConf FROM i_MasterDataConf TRANSPORTING X_STATUS.
Error:
"I_MASTERDATACONF" is a table without a header line and therefore has no component called "X_STATUS".
//Martin
‎2005 Feb 17 1:44 PM
Hi,
Some minor modifications, look at bold statements:
<b>DATA: wa_t_MasterDataStruct TYPE LINE OF tt_MasterDataStruct </b>.
>
> "i_MasterDataConf is of the type
> tt_MasterDataStruct"
>
>
> <b>wa_t_MasterDataConf-X_STATUS = 'CONFIRMED'.
> MODIFY i_MasterDataConf FROM wa_t_MasterDataConf
> TRANSPORTING X_STATUS.
> </b>
>
Regards
Message was edited by: Shehryar Khan
‎2005 Feb 17 2:01 PM
Getting there...
I got an error (Internal server error.)
It doesn't like the Modify statement.
data: wa_t_MasterDataStruct TYPE LINE OF tt_MasterDataStruct .
wa_t_MasterDataStruct-X_STATUS = 'CONFIRMED'.
MODIFY i_MasterDataConf FROM wa_t_MasterDataStruct TRANSPORTING X_STATUS.
//MA
‎2005 Feb 17 2:34 PM