2009 Feb 05 6:57 PM
Hi All,
I have to create a dialog program in which i have to call the transaction SM30(but not use the initial screen), i have to give the user option to specify a filter criteria but maintain the table name to be a constant value. Please guide me through this.
2009 Feb 05 7:09 PM
you can have a simple selection screen that SETs PARAMETER for table name, calls SM30 and skips first screen. If thats what you need.
Or
You can create a table maintenance transaction in SE93 (transaction with parameters), Enter default transaction (SM30/4) -> Skip Initial Screen, enter Screen fields and values (VCLDIR-VCLNAME = SHOW = 'X')
2009 Feb 05 7:12 PM
Hi,
Try using the below code...
set parameter id VIEWNAM_PARAMID field <table_name>.
call transaction SM30 and skip first screen.
Hope this helps you...
Regards,
Siddarth
2009 Feb 05 7:53 PM
Thanks a lot. But the requirement just changed.
I have a ZMRSDATA table. and the main requirment is i have to retrieve data from this table.
I have to develop a dialog program which lets the user fill in some filtration criteria like plant , material, date etc , fetch and display the records , make them select exactly one record and give them the option to change and save the record. Could you please help me with this?
2009 Feb 05 7:56 PM
Hi ,
You can do one thing use BDCDATA to fill the data only for the first screen.
and then call the transaction using <bdcdata table> using mode E so when it goes to the next screen it will stop and user will get the restriction screen....
Hope you understood ...
Regards,
Siddarth
2009 Feb 05 8:14 PM
Thanks Siddarth, but i think i no longer have to call SM30 i could directly select the data florm the table.
2009 Feb 05 8:18 PM
oh ok...
apologize for mistake...
In this case you can use search helps if they are available for the table and assign the search help with the parameter and then get the selection criteria,
then you can use select query and I think you will get all the records,
regards,
Siddarth
2009 Feb 05 8:29 PM
2009 Feb 05 8:35 PM
Rather i would prefer to create a simple dialog program with screens in them. I just want to know the procedure.
2009 Feb 05 8:36 PM
Hi.
This is not recommended for SAP Standard tables but since yours is a Z table:
1. Create a simple report program with a selection screen with all the selection criterion you need
2. Display data in an editable ALV or even a Table Control
3. Update your Z table from the edited values
Simple as 123 🐵
Edited by: NW on Feb 5, 2009 3:37 PM
2009 Feb 05 8:45 PM
Hi,
create parameters/select-options which ever is feasible for
plant , material, date fields refering to type of the table fields
then after the selections have been done.
using at selection-screen first validate whether the entries entered by the user are correct.
if its correct then in start-of-selection.
write select query in the where clause give the conditions refering to those variable names declared on the screen.
then you can proceed further what ever you want to do with that data.
Regards,
Siddarth
2009 Feb 05 9:17 PM
How to create the editable ALV? do you have any docs for it?
2009 Feb 05 9:17 PM
Ok i fetch the data and disply it , but how do i make it editable?
2009 Feb 05 9:20 PM
lvc_s_fcat-edit = 'X'. "sets whole column to be editable
These links should get you going.
/people/david.lees/blog/2009/01/16/abap-controls-trees-and-editable-alv-with-drag-drop
http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_editable.htm
Also, please search the forum and web so you can find something really helpful.
Edited by: NW on Feb 5, 2009 4:21 PM
2009 Feb 06 7:24 AM
Hi,
When you are displaying it on the list with the write statement you can use the addition as input on for which ever field you want it to be edited.
write <variable> input on.
once the user has finished editing the details and presses the update or save button,
you can then read the lines and then get the data from the list using
Read line statement
and then update them in the table.
Regards,
Siddarth
2009 Feb 06 6:55 PM
2009 Feb 07 5:50 AM
Hi
Check out this link for [Editable ALV|http://www.sapdev.co.uk/reporting/alv/alvgrid_editable.htm].
Check out the following code. It allows user to select values using selection screens and based on that displays records from the db. On selecting a line, further details are displayed.
REPORT YDEC17_IL_PGM2 NO STANDARD PAGE HEADING.
TABLES: SPFLI, SFLIGHT.
DATA: v_carrid LIKE SPFLI-CARRID,
v_connid LIKE SPFLI-CONNID.
TYPES: BEGIN OF list,
cityfrom LIKE SPFLI-CITYFROM,
cityto LIKE SPFLI-CITYTO,
deptime LIKE SPFLI-DEPTIME,
arrtime LIKE SPFLI-ARRTIME,
END OF list.
DATA it_list TYPE TABLE OF list WITH HEADER LINE.
TYPES: BEGIN OF flight,
fldate LIKE SFLIGHT-FLDATE,
price LIKE SFLIGHT-PRICE,
currency LIKE SFLIGHT-CURRENCY,
seatsmax LIKE SFLIGHT-SEATSMAX,
seatsocc LIKE SFLIGHT-SEATSOCC,
END OF flight.
DATA it_flight TYPE TABLE OF flight WITH HEADER LINE.
DATA v_freest TYPE I.
TOP-OF-PAGE.
WRITE 'Flight Details'.
SKIP.
START-OF-SELECTION.
WRITE: AT 10 'CARRID',
AT 20 'CONNID',
AT 30 'CITYFROM',
AT 50 'CITYTO',
AT 70 'DEPTIME',
AT 85 'ARRTIME'.
SKIP.
ULINE.
SKIP.
SELECT-OPTIONS: scarrid FOR v_carrid NO INTERVALS,
sconnid FOR v_connid NO INTERVALS.
LOOP AT scarrid.
v_carrid = scarrid-low.
SELECT CONNID into v_connid from SPFLI WHERE CARRID EQ scarrid-low.
IF SY-SUBRC EQ 4.
MESSAGE E001(YJK).
ENDIF.
ENDSELECT.
SELECT CITYFROM CITYTO DEPTIME ARRTIME into corresponding fields of it_list from SPFLI WHERE CARRID EQ scarrid-low.
IF SY-SUBRC EQ 4.
MESSAGE E001(YJK).
ENDIF.
ENDSELECT.
SKIP.
WRITE : AT 10 v_carrid,
AT 20 v_connid,
AT 30 it_list-cityfrom,
AT 50 it_list-cityto,
AT 70 it_list-deptime,
AT 85 it_list-arrtime.
SKIP.
HIDE : v_carrid, v_connid, it_list.
ENDLOOP.
LOOP AT sconnid.
SELECT CARRID into v_carrid from SPFLI WHERE CARRID EQ scarrid-low.
ENDSELECT.
v_connid = sconnid-low.
SELECT CITYFROM CITYTO DEPTIME ARRTIME into corresponding fields of it_list from SPFLI WHERE CARRID EQ scarrid-low.
IF SY-SUBRC EQ 4.
MESSAGE E001(YJK).
ENDIF.
ENDSELECT.
SKIP.
WRITE : AT 10 v_carrid,
AT 20 v_connid,
AT 30 it_list-cityfrom,
AT 50 it_list-cityto,
AT 70 it_list-deptime,
AT 85 it_list-arrtime.
SKIP.
HIDE : v_carrid, v_connid, it_list.
ENDLOOP.
AT LINE-SELECTION.
ULINE.ULINE.
skip.
WRITE: AT 10 'Date',
AT 30 'Price',
AT 50 'Max. Seats',
AT 65 'Seats Occupied',
AT 90 'Free Seats'.
ULINE.
SKIP.
SELECT FLDATE PRICE CURRENCY SEATSMAX SEATSOCC into corresponding fields of it_flight from SFLIGHT WHERE CONNID EQ v_connid.
IF SY-SUBRC EQ 4.
MESSAGE E001(YJK).
ENDIF.
ENDSELECT.
v_freest = it_flight-seatsmax + it_flight-seatsocc.
WRITE: AT 10 it_flight-fldate,
AT 30 it_flight-price LEFT-JUSTIFIED, AT 43 it_flight-currency ,
AT 50 it_flight-seatsmax LEFT-JUSTIFIED,
AT 65 it_fl
TOP-OF-PAGE DURING LINE-SELECTION.
WRITE : v_carrid,
ight-seatsocc LEFT-JUSTIFIED,
AT 90 v_freest LEFT-JUSTIFIED.
AT 10 v_connid,
AT 20 it_list-cityfrom,
AT 50 it_list-cityto,
AT 70 it_list-deptime,
AT 80 it_list-arrtime.Hope this helps
Regards,
Jayanthi.K
2009 Feb 09 3:38 PM
Thanks a lot Jayanthi, But the program uve given me just displays how do i edit a record and make changes to it?
2009 Feb 09 3:47 PM
Hi
Instead of SM30, u can use the fm VIEW_MAINTENANCE_CALL in order to call the maintenace program for a certain table.
Max
2009 Feb 07 6:19 AM
Hi,
Create Table maintenance generator for ur Z table and create a report prg with required select options and parameters. Then in ur prg call VIEW_MAINTENANCE_CALL function module. Using this fm we can select data records from z table based on given criteria.
Kindly go through the fm help. u will know the details.
sample code.
I have one select option and based on given input i will show the data from table.
DATA: tab_name TYPE dd02v-tabname,
dba_sele TYPE TABLE OF vimsellist WITH HEADER LINE,
tab_name = 'ZCUSTOMER_GRN'.
IF s_invdt-low IS NOT INITIAL AND s_invdt-HIGH IS NOT INITIAL .
CONCATENATE s_invdt-low6(2) s_invdt-low4(2) s_invdt-low+0(4) INTO s_date.
dba_sele-viewfield = 'INVDT'.
dba_sele-operator = 'GE'.
dba_sele-value = S_DATE. "S_MATNR-LOW.
dba_sele-and_or = 'AND'.
APPEND dba_sele.
CONCATENATE s_invdt-high6(2) s_invdt-high4(2) s_invdt-high+0(4) INTO t_date.
dba_sele-viewfield = 'INVDT'.
dba_sele-operator = 'LE'.
dba_sele-value = T_DATE. "S_MATNR-LOW.
APPEND dba_sele.
ENDIF.
CALL FUNCTION 'VIEW_MAINTENANCE_CALL'
EXPORTING
action = 'U'
view_name = tab_name
TABLES
DBA_SELLIST = dba_sele
EXCL_CUA_FUNCT =
EXCEPTIONS
CLIENT_REFERENCE = 1
FOREIGN_LOCK = 2
INVALID_ACTION = 3
NO_CLIENTINDEPENDENT_AUTH = 4
NO_DATABASE_FUNCTION = 5
NO_EDITOR_FUNCTION = 6
NO_SHOW_AUTH = 7
NO_TVDIR_ENTRY = 8
NO_UPD_AUTH = 9
ONLY_SHOW_ALLOWED = 10
SYSTEM_FAILURE = 11
UNKNOWN_FIELD_IN_DBA_SELLIST = 12
VIEW_NOT_FOUND = 13
MAINTENANCE_PROHIBITED = 14
OTHERS = 15
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Regards,
S.Senthil kumar
2009 Feb 11 3:16 AM