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

Program to maintain table

Former Member
0 Likes
2,473

Hi Experts,

I need a program which is used to maitain the table same as SM30, and i need to give the select options for this table even.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,068

Hi,

Below program could be useful for you. Just go through it.

Program

REPORT zsdr_maintain_table.

DATA: action.

DATA: BEGIN OF i_sellist OCCURS 0.

INCLUDE STRUCTURE vimsellist.

DATA: END OF i_sellist.

TABLES sscrfields.

PARAMETERS: p_vkorg TYPE tvko-vkorg OBLIGATORY,

p_usd RADIOBUTTON GROUP lim, " Limit by USD

p_qty RADIOBUTTON GROUP lim. " Limit by Quantity

SELECTION-SCREEN SKIP 1.

SELECTION-SCREEN PUSHBUTTON /1(15) disp USER-COMMAND disp.

SELECTION-SCREEN PUSHBUTTON 20(15) maint USER-COMMAND maint.

INITIALIZATION.

MOVE 'Display' TO disp.

MOVE 'Maintain' TO maint.

AT SELECTION-SCREEN.

  • Authority check here

IF sscrfields-ucomm = 'MAINT'.

action = 'U'.

ELSE.

action = 'S'.

ENDIF.

  • Selection list

CLEAR: i_sellist.

REFRESH: i_sellist.

i_sellist-viewfield = 'VKORG'.

i_sellist-operator = 'EQ'.

i_sellist-value = p_vkorg.

i_sellist-and_or = 'AND'.

APPEND i_sellist.

IF p_usd = space.

i_sellist-operator = 'NE'.

ENDIF.

i_sellist-viewfield = 'ZUNIT'.

i_sellist-value = 'USD'.

APPEND i_sellist.

  • Disallow blank unit

i_sellist-viewfield = 'ZUNIT'.

i_sellist-operator = 'NE'.

i_sellist-value = space.

APPEND i_sellist.

CALL FUNCTION 'VIEW_MAINTENANCE_CALL'

EXPORTING

action = action

view_name = 'ZSD_MIN_ORDER'

TABLES

dba_sellist = i_sellist.

4 REPLIES 4
Read only

learnsap
Active Participant
0 Likes
1,068

Hi Karthick,

Generate the table maintenance using SM30 for your table, SAP creates a Z function group and Z Program in which you can modify as per your requirement.

Regards,

Ramesh

Read only

Former Member
0 Likes
1,068

Hi,

i u want to maintain the table first u have make a mentanance generator for it...

fr tis u go back to SE11 thr u first activate the table then in the utillity u got an option fr mantenance genrator create it....after tht u go to SM30 .

hope ths will help u.........

regards

Ritesh jha

Read only

former_member451655
Active Participant
0 Likes
1,068

hi ,

you can do something like this , if you cant goto a Maintainance view via SM 30 ,

Dispaly the Z table into a ALV Grid with couple of Buttons like 'Create, Delete, Change...Ect)

steps

1.Create a Transparents Table With All Required Fields

2.Populate All the Fields into a ALV Grid From that Table

3.Create 3 Buttons at the ALv Header ( Create , Edit, delete)

4.Create a Screen with All feilds

5.When The user Click on Create Button System will go to Newly Created Screen and allow User to Do a New Entey

6.When User Selects an Entry in the ALV and Click on Edit , system will call the same Screen with Aloowing Only to Edit the Rate

7.Delete also same , it wil delete Selected Raw from the ALV

Hope this Flow is OK for your Requirement , feel free to contact if anything Needed

Read only

Former Member
0 Likes
1,069

Hi,

Below program could be useful for you. Just go through it.

Program

REPORT zsdr_maintain_table.

DATA: action.

DATA: BEGIN OF i_sellist OCCURS 0.

INCLUDE STRUCTURE vimsellist.

DATA: END OF i_sellist.

TABLES sscrfields.

PARAMETERS: p_vkorg TYPE tvko-vkorg OBLIGATORY,

p_usd RADIOBUTTON GROUP lim, " Limit by USD

p_qty RADIOBUTTON GROUP lim. " Limit by Quantity

SELECTION-SCREEN SKIP 1.

SELECTION-SCREEN PUSHBUTTON /1(15) disp USER-COMMAND disp.

SELECTION-SCREEN PUSHBUTTON 20(15) maint USER-COMMAND maint.

INITIALIZATION.

MOVE 'Display' TO disp.

MOVE 'Maintain' TO maint.

AT SELECTION-SCREEN.

  • Authority check here

IF sscrfields-ucomm = 'MAINT'.

action = 'U'.

ELSE.

action = 'S'.

ENDIF.

  • Selection list

CLEAR: i_sellist.

REFRESH: i_sellist.

i_sellist-viewfield = 'VKORG'.

i_sellist-operator = 'EQ'.

i_sellist-value = p_vkorg.

i_sellist-and_or = 'AND'.

APPEND i_sellist.

IF p_usd = space.

i_sellist-operator = 'NE'.

ENDIF.

i_sellist-viewfield = 'ZUNIT'.

i_sellist-value = 'USD'.

APPEND i_sellist.

  • Disallow blank unit

i_sellist-viewfield = 'ZUNIT'.

i_sellist-operator = 'NE'.

i_sellist-value = space.

APPEND i_sellist.

CALL FUNCTION 'VIEW_MAINTENANCE_CALL'

EXPORTING

action = action

view_name = 'ZSD_MIN_ORDER'

TABLES

dba_sellist = i_sellist.