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

Tree structure tabs - How to save?

Former Member
0 Likes
611

Now I have 3 tabs for my tree tabs with different values keyed inside them. When I clicked on the "Save" button, the information will be saved into respective tables inside database.

How am I suppose to do that? Code examples in appreciated and I will reward all helpful answers.

Now I have 3 tabs for my tree tabs with different values keyed inside them. When I clicked on the "Save" button, the information will be saved into respective tables inside database.

How am I suppose to do that? Code examples in appreciated and I will reward all helpful answers.

3 REPLIES 3
Read only

Former Member
0 Likes
550

hi,

CODE:

create internal table and first place the values into it.

IF SY-UCOMM EQ 'SAVE'. /* if save is clicked*/

INSERT INTO DBTAB FROM ITAB. /* inserting values to database table from internal table*/

IF SY-SUBRC = 0 . /* to check whether data is inserted*/

MESSAGE S000 WITH 'DATA ENTERED SUCCESSFULLY '.

ELSE.

MESSAGE E000(ZSCREENMESS) WITH 'DATA NOT INSERTED' .

ENDIF .

REWARD IF USEFUL,

thanks and regards,

suma sailaja pvn

Edited by: suma sailaja pvn on Jan 8, 2008 5:51 AM

Read only

Former Member
0 Likes
550

Hai,

I am not sure but try this.

select the respective fields which u have to save in table based on keys into work area and modify original table with work area.please go through the below code,it may give u some idea,in the below code i have to store entries from different tables in to one table.

FUNCTION zbapi_methodology_buildtree.

*"----


""Local Interface:

*" TABLES

*" ET_PHCODE STRUCTURE ZBAPI_BUILDTREE

*"----


TYPES : BEGIN OF structure_build,

progcode TYPE zse_projmethod1-progcode,

seprojcode TYPE zse_projmethod1-seprojcode,

phcode TYPE zse_projmethod1-phcode,

shortkey TYPE zse_projmethod1-shortkey,

wpcode TYPE zse_projmethod1-wpcode,

actcode TYPE zse_projmethod1-actcode,

tascode TYPE zse_projmethod1-tascode,

END OF structure_build.

TYPES : BEGIN OF struct_pm,

phcode TYPE zse_phase-phcode,

wpcode TYPE zse_workpackage-wpcode,

actcode TYPE zse_activities-actcode,

tascode TYPE zse_tasks-tascode,

END OF struct_pm.

TYPES : BEGIN OF struct_phcode,

phcode TYPE zse_phase-phcode,

END OF struct_phcode.

TYPES : BEGIN OF struct_wpcode,

phcode TYPE zse_phase-phcode,

wpcode TYPE zse_workpackage-wpcode,

END OF struct_wpcode.

TYPES : BEGIN OF struct_actcode,

phcode TYPE zse_phase-phcode,

wpcode TYPE zse_workpackage-wpcode,

actcode TYPE zse_activities-actcode,

END OF struct_actcode.

TYPES : BEGIN OF struct_tascode,

phcode TYPE zse_phase-phcode,

wpcode TYPE zse_workpackage-wpcode,

actcode TYPE zse_activities-actcode,

tascode TYPE zse_tasks-tascode,

END OF struct_tascode.

DATA : tab_pm TYPE TABLE OF struct_pm ,

tab_build TYPE TABLE OF structure_build,

wa_build TYPE zse_projmethod1,

wa_pm TYPE struct_pm ,

wa_phcode TYPE struct_phcode ,

wa_wpcode TYPE struct_wpcode ,

wa_actcode TYPE struct_actcode ,

wa_tascode TYPE struct_tascode.

DATA : v_phcode TYPE zse_phase-phcode,

v_wpcode TYPE zse_workpackage-wpcode,

v_actcode TYPE zse_activities-actcode.

SELECT phcode FROM zse_phase INTO wa_phcode WHERE loekz EQ 'X'.

APPEND wa_phcode TO tab_pm.

v_phcode = wa_phcode-phcode.

SELECT phcode wpcode FROM zse_workpackage INTO wa_wpcode WHERE phcode = v_phcode AND loekz EQ 'X'.

APPEND wa_wpcode TO tab_pm.

v_wpcode = wa_wpcode-wpcode.

SELECT phcode wpcode actcode FROM zse_activities INTO wa_actcode WHERE phcode = v_phcode AND wpcode = v_wpcode AND loekz EQ 'X'.

APPEND wa_actcode TO tab_pm.

v_actcode = wa_actcode-actcode.

SELECT phcode wpcode actcode tascode FROM zse_tasks INTO wa_tascode WHERE phcode = v_phcode AND wpcode = v_wpcode

AND actcode = v_actcode AND loekz EQ 'X'.

APPEND wa_tascode TO tab_pm.

  • update zse_tasks set loekz = ' ' where tascode = v_tascode.

ENDSELECT.

  • update zse_activities set loekz = ' ' where actcode = v_actcode.

ENDSELECT.

  • update zse_workpakage set loekz = ' ' where wpcode = v_wpcode.

ENDSELECT.

  • update zse_phase set loekz = ' ' where phcode = v_phcode.

ENDSELECT.

et_phcode[] = tab_pm[].

LOOP AT tab_pm INTO wa_pm.

move-corresponding wa_pm to wa_build.

MODIFY zse_projmethod1 FROM wa_build.

endloop.

ENDFUNCTION.

With Regards,

Sowjanya.B.

Read only

Former Member
0 Likes
550

Then how to I get the value that the user type in a textbox of one of the tab screen and save this value to a field(Name) of database(ZHERA)? eg the textbox name is IO_NAME. How am I suppose to do that?