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

MODIFY

Former Member
0 Likes
691

What does the MODIFY operation do?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
662

Hi Krishna,

PLS check SAP HELP

MODIFY dbtab

Syntax

MODIFY target FROM source.

Effect

The MODIFY statement inserts one or several lines specified in source in the database table specified in target, or overwrites existing lines.

System fields

The MODIFY statement sets the values of the sy-subrc and sy-dbcnt system fields.

sy-subrc Meaning

0 All lines were inserted or changed.

4 At least one line could not be processed as there is already a line with the same unique name secondary index in the database table.

The MODIFY statement sets sy-dbcnt to the number of processed lines.

Note

The changes are finally transferred to the database table with the next database commit. Up to that point, they can be reversed with a database rollback.

The MODIFY statement sets a database lock until the next database commit or database rollback; incorrect usage can result in a deadlock kommen kann.

The number of rows that can be inserted into or changed in the tables of a database within a database LUW is restricted database-specifically by the fact that a database system can only manage a limited amount of locks and data in the rollback area.

Regards,

Sarath

5 REPLIES 5
Read only

Former Member
0 Likes
663

Hi Krishna,

PLS check SAP HELP

MODIFY dbtab

Syntax

MODIFY target FROM source.

Effect

The MODIFY statement inserts one or several lines specified in source in the database table specified in target, or overwrites existing lines.

System fields

The MODIFY statement sets the values of the sy-subrc and sy-dbcnt system fields.

sy-subrc Meaning

0 All lines were inserted or changed.

4 At least one line could not be processed as there is already a line with the same unique name secondary index in the database table.

The MODIFY statement sets sy-dbcnt to the number of processed lines.

Note

The changes are finally transferred to the database table with the next database commit. Up to that point, they can be reversed with a database rollback.

The MODIFY statement sets a database lock until the next database commit or database rollback; incorrect usage can result in a deadlock kommen kann.

The number of rows that can be inserted into or changed in the tables of a database within a database LUW is restricted database-specifically by the fact that a database system can only manage a limited amount of locks and data in the rollback area.

Regards,

Sarath

Read only

Former Member
0 Likes
662

hi,

Modify-

when use this for <b>db table</b>:

Change a database table

->Inserts new lines or updates existing lines in a database table .

if we use <b>in internal table</b>:

Change an internal table

->Changes an entry in the internal table itab .

if we use in the <b>list:</b>

->Changes the n th line of the list

if we use this along with <b>SCREEN</b>

Change the attributes of a screen field

Changes the attributes belonging to the current screen field whilst processing with LOOP AT SCREEN ... ENDLOOP .

Read only

Former Member
0 Likes
662

hi krishna ,

you are asking about modify,

in SAP there a lot of thing u can do with this operation : here are some example of them :

A. <b>MODIFY</b> => using to inserts new lines or updates existing lines in a database table OR INTERNAL TABLE. with modify you can perform as INSERT command if the If a line with the specified primary key have not exists , and if the primary key already exist that command will perform as UPDATE command.

<u>Below is the syntax example</u> :

1. MODIFY dbtab. or

MODIFY *dbtab. or

MODIFY (dbtabname) ... . .

2. MODIFY dbtab FROM TABLE itab. or

MODIFY (dbtabname) FROM TABLE itab.

3. MODIFY dbtab VERSION vers. or

MODIFY *dbtab VERSION vers.

4.MODIFY dbtab FROM TABLE itab. or

MODIFY (dbtabname) FROM TABLE itab.

B. <b>MODIFY</b> => USING ON SCREEN COMMAND=>Modifying Input Fields

To modify the appearance of an input field on the selection screen, you must assign the parameter to a modification group as follows:

PARAMETERS p ...... MODIF ID key ......

The name of modification group key should be a three-character variable name without quotation marks. The MODIF ID addition always assigns key to the screen-group1 column of internal table screen. Parameters assigned to a modification group can be processed as an entire group with the LOOP AT SCREEN and MODIFY SCREEN statements during the AT SELECTION-SCREEN OUTPUT event.

syntax example :

REPORT demo_sel_screen_param_modif.

PARAMETERS: test1(10) TYPE c MODIF ID sc1,

test2(10) TYPE c MODIF ID sc2,

test3(10) TYPE c MODIF ID sc1,

test4(10) TYPE c MODIF ID sc2.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF screen-group1 = 'SC1'.

screen-intensified = '1'.

MODIFY SCREEN.

CONTINUE.

ENDIF.

IF screen-group1 = 'SC2'.

screen-intensified = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Read only

Former Member
0 Likes
662

Hi,

To be in Simple:

Modify on database/ internal table:

- will insert a new record , if record doesnt exist with that primary key.

-will update the existing record , if record already exist with that primary key.

Revert back if any issues,

Reward with points if helpful.

Regards,

Naveen

Read only

Former Member
0 Likes
662

Hi Krishna Latha,

MODIFY Statement can modify the internal table, may be Screen or any other table, By using MODIFY Statement u can modify data in the internal table

and also u can modify how many fields u want Using modify statement.

Thanks & Regards,

jogu_vinesh@yahoo.com