cancel
Showing results for 
Search instead for 
Did you mean: 

How to assign one fixed value to one ITAB's field

santosh_tankala
Explorer
0 Kudos
77

Hi All,

wanted to know like how to assign one fixed value to one internal table's field. Lets say like I have one fiscal period-004.2016 wanted to assign that to ITAB-FISCPER /Result_package-Fiscper for all entries. Please post the pseudo code here.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Did you try the LOOP AT internal table ASSIGNING a field-symbol, so no move of data is executed, unlike using work area, which would move from and back each and every record, a LOOP AT itab ASSIGNING <fs> (of the correct type, not a ANY TYPE) then <fs>-bukrs = '030' and ENDLOOP. should also have performed correctly. (In fact the MODIFY WHERE TRANSPORTING performs this way)

Regards

jay_reddy1
Active Participant
0 Kudos

try constant value

or

code:--

loop at itab into wa.

wa-fiscper = "004.2016".

modify itab from wa index sy-tabix.

endloop.

santosh_tankala
Explorer
0 Kudos

Hi Jay,

Thank you.. Is there any way to assign with out using loop ?

jay_reddy1
Active Participant
0 Kudos

no, we need to use loop to assign value

Former Member
0 Kudos

Hi Santosh,

Your requirement is not very clear.

However, if you need the fiscal period a same for all entries why don't you use the constant?

Did you try any code yet to achieve this?

Where is this fiscal period value coming from? Where are you trying the code - end routine? Is there any specific logic for the fiscal period value?

Assigning the value is simple but it is important to understand the context in which you are trying this.

Thanks

Amit