2008 Feb 29 5:33 AM
Hello everyone,
could any one send me the coding part of how to upload the
data from table control to a custom table
and also how to retrieve the data from custom table to table control..
its very urgent requirement..
will be rewarded..
2008 Feb 29 5:43 AM
DATA: BEGIN OF FS_SPFLI,
MANDT TYPE SPFLI-MANDT,
CARRID TYPE SPFLI-CARRID,
CONNID TYPE SPFLI-CONNID,
COUNTRYFR TYPE SPFLI-COUNTRYFR,
END OF FS_SPFLI.
DATA: BEGIN OF FS_SFLIGHT,
MANDT TYPE SFLIGHT-MANDT,
CARRID TYPE SFLIGHT-CARRID,
CONNID TYPE SFLIGHT-CONNID,
FLDATE TYPE SFLIGHT-FLDATE,
END OF FS_SFLIGHT.
data:
t_spfli like standard table of fs_spfli,
t_sflight like standard table of fs_sflight,
ok_code type sy-ucomm.
controls:
c_tabstrip type tabstrip.
select *
from spfli
into corresponding fields of table t_spfli.
select *
from sflight
into corresponding fields of table t_sflight.
call screen 101.
*call screen 102.
*call screen 103.
&----
*& Module STATUS_0101 OUTPUT
&----
text
-
MODULE STATUS_0101 OUTPUT.
SET PF-STATUS 'TABSTRIP'.
SET TITLEBAR 'TABSTRIP'.
ENDMODULE. " STATUS_0101 OUTPUT
&----
*& Module USER_COMMAND_0101 INPUT
&----
text
-
MODULE USER_COMMAND_0101 INPUT.
case ok_code.
when 'BACK' or 'EXIT'.
leave program.
clear ok_code.
when 'SPFLI'.
leave to list-processing.
loop at t_spfli into fs_spfli.
write:/
fs_spfli.
endloop.
clear ok_code.
when 'SFLIGHT'.
leave to list-processing.
loop at t_sflight into fs_sflight.
write:/
fs_sflight.
endloop.
clear ok_code.
endcase.
ENDMODULE. " USER_COMMAND_0101 INPUT
Before you execute the code, double click on 101,i.e., in CALL SCREEN 101.
And paste the below code in Flow logic.
PROCESS BEFORE OUTPUT.
MODULE STATUS_0101.
call subscreen spfli_ref1 including sy-repid '102'.
call subscreen sflight_ref1 including sy-repid '103'.
*
PROCESS AFTER INPUT.
call subscreen: spfli_ref1, sflight_ref1.
MODULE USER_COMMAND_0101.
DATA: BEGIN OF FS_SPFLI,
MANDT TYPE SPFLI-MANDT,
CARRID TYPE SPFLI-CARRID,
CONNID TYPE SPFLI-CONNID,
COUNTRYFR TYPE SPFLI-COUNTRYFR,
END OF FS_SPFLI.
DATA: BEGIN OF FS_SFLIGHT,
MANDT TYPE SFLIGHT-MANDT,
CARRID TYPE SFLIGHT-CARRID,
CONNID TYPE SFLIGHT-CONNID,
FLDATE TYPE SFLIGHT-FLDATE,
END OF FS_SFLIGHT.
data:
t_spfli like standard table of fs_spfli,
t_sflight like standard table of fs_sflight,
ok_code type sy-ucomm.
controls:
c_tabstrip type tabstrip.
select *
from spfli
into corresponding fields of table t_spfli.
select *
from sflight
into corresponding fields of table t_sflight.
call screen 101.
*call screen 102.
*call screen 103.
&----
*& Module STATUS_0101 OUTPUT
&----
text
-
MODULE STATUS_0101 OUTPUT.
SET PF-STATUS 'TABSTRIP'.
SET TITLEBAR 'TABSTRIP'.
ENDMODULE. " STATUS_0101 OUTPUT
&----
*& Module USER_COMMAND_0101 INPUT
&----
text
-
MODULE USER_COMMAND_0101 INPUT.
case ok_code.
when 'BACK' or 'EXIT'.
leave program.
clear ok_code.
when 'SPFLI'.
leave to list-processing.
loop at t_spfli into fs_spfli.
write:/
fs_spfli.
endloop.
clear ok_code.
when 'SFLIGHT'.
leave to list-processing.
loop at t_sflight into fs_sflight.
write:/
fs_sflight.
endloop.
clear ok_code.
endcase.
ENDMODULE. " USER_COMMAND_0101 INPUT
Before you execute the code, double click on 101,i.e., in CALL SCREEN 101.
And paste the below code in Flow logic.
PROCESS BEFORE OUTPUT.
MODULE STATUS_0101.
call subscreen spfli_ref1 including sy-repid '102'.
call subscreen sflight_ref1 including sy-repid '103'.
*
PROCESS AFTER INPUT.
call subscreen: spfli_ref1, sflight_ref1.
MODULE USER_COMMAND_0101.
2008 Feb 29 5:43 AM
hi,
to save the data use this in PAI.
module tabctrl input.
case sy-ucomm.
when 'SAVE'.
if save1 = 1.
modify wi_cust1 index tb-current_line.
if sy-subrc = 0.
modify zcust_master2 from table wi_cust1.
message s005(zmsgbanks1).
else.
message e006(zmsgbanks1).
endif.
endif.
endcase.
to display data:
select * from zcust_master2 into table wi_cust1. "This uploads the table control with data from customer master
tb-lines = sy-dbcnt.
hope this helps u,
Reagrds,
Arunsri
2008 Feb 29 5:57 AM
hi anusri,
can u send me the code in some what detail.. iam getting ur answer but not completely ,, please help me out....
2008 Feb 29 5:43 AM
DATA: BEGIN OF FS_SPFLI,
MANDT TYPE SPFLI-MANDT,
CARRID TYPE SPFLI-CARRID,
CONNID TYPE SPFLI-CONNID,
COUNTRYFR TYPE SPFLI-COUNTRYFR,
END OF FS_SPFLI.
DATA: BEGIN OF FS_SFLIGHT,
MANDT TYPE SFLIGHT-MANDT,
CARRID TYPE SFLIGHT-CARRID,
CONNID TYPE SFLIGHT-CONNID,
FLDATE TYPE SFLIGHT-FLDATE,
END OF FS_SFLIGHT.
data:
t_spfli like standard table of fs_spfli,
t_sflight like standard table of fs_sflight,
ok_code type sy-ucomm.
controls:
c_tabstrip type tabstrip.
select *
from spfli
into corresponding fields of table t_spfli.
select *
from sflight
into corresponding fields of table t_sflight.
call screen 101.
*call screen 102.
*call screen 103.
&----
*& Module STATUS_0101 OUTPUT
&----
text
-
MODULE STATUS_0101 OUTPUT.
SET PF-STATUS 'TABSTRIP'.
SET TITLEBAR 'TABSTRIP'.
ENDMODULE. " STATUS_0101 OUTPUT
&----
*& Module USER_COMMAND_0101 INPUT
&----
text
-
MODULE USER_COMMAND_0101 INPUT.
case ok_code.
when 'BACK' or 'EXIT'.
leave program.
clear ok_code.
when 'SPFLI'.
leave to list-processing.
loop at t_spfli into fs_spfli.
write:/
fs_spfli.
endloop.
clear ok_code.
when 'SFLIGHT'.
leave to list-processing.
loop at t_sflight into fs_sflight.
write:/
fs_sflight.
endloop.
clear ok_code.
endcase.
ENDMODULE. " USER_COMMAND_0101 INPUT
Before you execute the code, double click on 101,i.e., in CALL SCREEN 101.
And paste the below code in Flow logic.
PROCESS BEFORE OUTPUT.
MODULE STATUS_0101.
call subscreen spfli_ref1 including sy-repid '102'.
call subscreen sflight_ref1 including sy-repid '103'.
*
PROCESS AFTER INPUT.
call subscreen: spfli_ref1, sflight_ref1.
MODULE USER_COMMAND_0101.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |