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 standard table

Former Member
0 Likes
819

Hi,

I would like to modify SAP standard table that is vbrk, vbrp . but i am not getting how to modify it.

please, explain me..

Manoj

You could have got enough help by searching

Edited by: Suresh Datti on Aug 23, 2009 2:56 PM

3 REPLIES 3
Read only

sridhar_meesala
Active Contributor
0 Likes
540

Hi,

It is no advisable to modify a standard table. If it is required you can use a BAPI to do that.

Also have a look at the link.

[]

Thanks,

Sri.

Read only

Former Member
0 Likes
540

Hi Manoj

Do you want to insert the data in database table or update data in database table ? see following example for insertion & updation

Example

DATA : IT_TAB1 type table of FAGLFLEXA with header line,

V_dmbtr TYPE FAGLFLEXA-TSL VALUE ' ' .

start-OF-SELECTION .

BREAK-POINT .

SELECT * FROM FAGLFLEXA into CORRESPONDING FIELDS OF TABLE IT_TAB1

WHERE RYEAR = '2008'

AND DOCNR = '0041018110'

AND RBUKRS = 'BUKRS'

AND BSCHL = '40'

AND RACCT = '0000245612' .

BREAK-POINT .

LOOP at IT_TAB1 .

IT_TAB1-DOCNR = '0041018110' .

IT_TAB1-DOCLN = '000008' .

IT_TAB1-RACCT = '0000245612' .

IT_TAB1-PRCTR = '0000003012' .

IT_TAB1-PPRCTR = '0000003004' .

IT_TAB1-TSL = '-180.50'.

IT_TAB1-WSL = '-180.50' .

IT_TAB1-HSL = '-180.50' .

IT_TAB1-BSCHL = '50' .

IT_TAB1-DRCRK = 'H' .

MODIFY IT_TAB1 TRANSPORTING DOCNR docln racct prctr pprctr tsl wsl hsl bschl drcrk .

ENDLOOP .

BREAK-POINT .

if IT_TAB1[] is NOT INITIAL .

MODIFY FAGLFLEXA from TABLE IT_TAB1[].

COMMIT WORK.

endif.

Example 2 for updation

TABLES : anlc,anlb.

start-OF-SELECTION .

SELECTION-SCREEN BEGIN OF BLOCK b11 WITH FRAME TITLE text-001 .

PARAMETERS : bukrs LIKE anlc-bukrs,

anln1 LIKE anlc-anln1,

gjahr LIKE anlc-gjahr.

SELECTION-SCREEN END OF BLOCK b11.

UPDATE anlc SET gjahr = '2008' WHERE bukrs = bukrs

AND anln1 = anln1

AND gjahr = '2007' .

Edited by: sai_abap on Aug 22, 2009 1:05 PM

Read only

Former Member
0 Likes
540

hii manoj,

APPEND structures AND CUSTOMIZING INCLUDES.

these are the two methods.. but customizing includes we, as a developers do not use.

generally we use .APPEND structures to modify standard tables.

note that we need an access key to modify standard tables.

we can create an apend structure and add that structure to the standard table at the end.

note that .append structures should only be added only at the end.

that is the reason we use .append structures to modify standard tables.as we should not include a field in the middle and disturb the original order of the standard table fields as it may effect many objects depending on the standard table.

but Some standard tables for which there is a LONG datatype field can never be modified.

the reason is the LONG datatype field should always be there at the end and also .APPEND strutures should always be there at the end. there will be a conflict. so, some standard tables can not be appended.

rgrds,

Shweta