Application Development 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: 

Can I insert a value(a) into a column(1) in a structure (X).

Former Member
0 Kudos
435

Hello All,

Can I insert a value(a) into a column(1) in a structure (X).

Can anyone give me the syntax.

Thanks and Regards.

Srinivas

1 ACCEPTED SOLUTION

0 Kudos
175

Remember that the structure holds data only at runtime. If you are aware then the syntax is;

Data: l_stru type X,

l_stru-column = 'a'.

The 'column' is one of the fields of the struture.

Hope this helps,

Sudhi

9 REPLIES 9

suresh_datti
Active Contributor
0 Kudos
175

No.. you cannot insert values into a structure.. you can only us eit during runtime to hold a single record at a time ie

struc-field = <value>.

~Suresh

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
175

Sure you can move any value into any variable at runtime. For example, say you have a structure in your program called XSTRUC and you have 3 fields inside this structure FLD1, FLD2 and FLD3, and say you want to fill this field with a value. Here is the syntax.

XSTRUC-FLD2 = 'Value'.

Regards,

Rich Heilman

0 Kudos
176

Remember that the structure holds data only at runtime. If you are aware then the syntax is;

Data: l_stru type X,

l_stru-column = 'a'.

The 'column' is one of the fields of the struture.

Hope this helps,

Sudhi

0 Kudos
175

At runtime I need to enter a value into a standard table HRP5125. What method should I follow.

If I am declaring a structure and insterting value into the structure. Will it be inserted into table.

Thanks

0 Kudos
175

Use the MODIFY statement

data: xHRP5125 type HRP5125.


xHRP5125-some_field  = 'SomeValue'.
modify HRP5125 from xHRP5125.

Regards,

Rich Heilman

0 Kudos
175

Hi Rich,

The thing is the tables as such are on a different system(e-recruitment). I am trying to send information to those tables from tables on current system. I am able to use the structures based on the e-Rec system tables.

If I use say

erec_s_api_p5125-<field-name> = value;

Will it not update the table on e-Rec system?

Thanks and Regards.

Srinivas

0 Kudos
175

Assuming you are sending your values using a function module (RFC?) call to the other system and assuming the function module as it is implemented in the other system to update the databased table fields - yes sure the tables will then be updated.

For this you need to know what is happening in the 'e-Rec" system

amit_khare
Active Contributor
0 Kudos
175

Structures are like a row of a table, you can save anything in it.

They act as a temporary holder of the one record at a time.

They are something like work areas in an ABAP program.'

Regards,

Amit

0 Kudos
175

Thanks All!