Application Development and Automation 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: 
Read only

Modyfing Data in internal table

Former Member
0 Likes
1,696

Hi All,

Is there a way to modify data present in internal table of one program from a BADI.

For example in program 'SAPMV13A', include 'MV13AF0K' contains function module for BADI method 'SD_CONDITION_SAVE_EXIT'. I want to change internal table data (time_vake_db) present in include'MV13AF0K' from BADI method.

Is there a way out to change?

Thanks.

1 ACCEPTED SOLUTION
Read only

former_member194669
Active Contributor
0 Likes
1,360

You can only change the following internal in the badi mentioned

CT_TIME

CT_KONH_NEW

CT_KONH_OLD

CT_KONPDB_NEW

CT_KONPDB_OLD

CT_SCALE_NEW

CT_SCALE_OLD

CT_KONDAT_NEW

CT_KONDAT_OLD

CT_VAKE

Hi All,

Is there a way to modify data present in internal table of one program from a BADI.

For example in program 'SAPMV13A', include 'MV13AF0K' contains function module for BADI method 'SD_CONDITION_SAVE_EXIT'. I want to change internal table data (time_vake_db) present in include'MV13AF0K' from BADI method.

Is there a way out to change?

Thanks.

7 REPLIES 7
Read only

former_member194669
Active Contributor
0 Likes
1,361

You can only change the following internal in the badi mentioned

CT_TIME

CT_KONH_NEW

CT_KONH_OLD

CT_KONPDB_NEW

CT_KONPDB_OLD

CT_SCALE_NEW

CT_SCALE_OLD

CT_KONDAT_NEW

CT_KONDAT_OLD

CT_VAKE

Read only

0 Likes
1,360

Hi Thanks for your reply. Actually my problem is this:

I have using a method 'CONDITION_SAVE_EXIT' in BADI 'SD_CONDI_SAVE_A' for VK11 & VK12 transaction, where when customer enters start date as any past/current date the BADI should automatically update the start date to current date. The problem in BADi is the data that is being transferred into function module ('SD_CONDITION_SAVE_EXIT') is being copied into internal tanle and this copied table data is available for me while programming. Now the problem is as data is being copied into internal table when I update this data (the start date) the data is not being reflected in main program and condition is being stroed with user entered date itself.

I came to that the main internal data can be changed using update statement on internal table (sAPLV13A)db_xkondat[].

If so can anybody please specify the coding for this staement, when I code with the statement

MODIFY (sAPLV13A)db_xkondat[] from wa_kondat_new INDEX l_line.

it's giving error messgae AFTER "(SAPLV13A)", THERE MUST BE A SPACE OR EQUIVALENT CHARACTER (";", "," ".").

Thanks

Read only

0 Likes
1,360

Hi,

Declare a


FIELD-SYMBOLS: <fs_xkondt> TYPE ANY TABLE.
ASSIGN '(SAPLV13A)DB_XKONDAT[]' TO <fs_xkondt>.

Declare an other internal table with the structure of VKONDAT.

pass <fs_xkondt> to internal table and modify the data in the internal table.

Now pass the modified internal table data to DB_XKONDAT[].

Now also the record in DB_XKONDAT will be modified.

Check this will help you,

Regards

Dillip

Read only

0 Likes
1,360

Hi Dilip,

Thanks for your reply.

When I declare field-symbol that you specified it is giving an error "' (SAPLV13A)DB_XKONDAT[]' is not type-compatible with field-symbol '<fs_xkondt>'". Even if declared as ASSIGN (SAPLV13A)DB_XKONDAT[] TO <fs_xkondt>. (w/o quotes) its giving error "After "(SAPLV13A)", there must be a space or equivalent character (";", ",", ".")."

Please let me know at the earliest if you can unscrew this error.

Thanks in Advance.

Read only

0 Likes
1,360

Hi,

Try with this


   DATA:   IT_VKONDAT TYPE TABLE OF VKONDAT,
                WA_VKONDAT TYPE VKONDAT.
    DATA: LW_VAR(40) TYPE C.

    FIELD-SYMBOLS: <FS_XKONDT> TYPE ANY TABLE.

   LW_VAR = '(SAPLV13A)DB_XKONDAT[]'.
    ASSIGN (LW_VAR)  TO <FS_XKONDT>.

    IF SY-SUBRC = 0.
      IT_VKONDAT[] =  <FS_XKONDT>.
    ENDIF.
LOOP AT IT_VKONDAT INTO WA_VKONDAT.
WA_VKONDAT-DATAB = SY-DATUM.
WA_VKONDAT-KZ = 'U'.    " UPDATE INDICATOR
MODIFY IT_VKONDAT FROM WA_VKONDAT INDEX SY-TABIX.
ENDLOOP.

DB_XKONDAT[] = IT_VKONDAT[].

I have used in the same maner and it worked for me.

Hope this will help U.

Regards

Dillip

Read only

0 Likes
1,360

Hi Dilip,

Amazing!!!!!! It answered my request. Thanks a lot.

Thanks.

Read only

GSerfiotis
Participant
0 Likes
1,360

Dillip,

your answer was very helpful for me as well. Thanks!