Header in Table Maintenance
Hi All,
Is it possible to add header to table maintenance view?
Thanks,
Jim
Hi,
Go to SE51..
GIve the program name - SAPL + "Function group name"..
Give the screen number
Press change button..
in the event PROCESS BEFORE OUTPUT.
Give
MODULE UPDATE_TEXT.
Double click on UPDATE_TEXT..It will ask whether you want to create a module...
Press yes...
Give a new include name...
Save the module and generate...
Thanks,
Naren
Similar Messages
-
Table maintenance generator, header name missing
I have recreated a table maintenance generator after adding two new fields, by the below process.
1. Go to the table maintenence generator from SE11, in Change Mode.
2. Click on change icon. The system will show the 'Change Generation Elements' screen where it sill ask you the resson
for change.
3. Click on the New Field/Sec. table in struction (or whichever is appropriate/applicable in your case)
4. Press Ok (Tick sign).
5. Then it will show you the ''Change Generation Elements: Detail' screen.Here;
=> You will select the maintenance screen that you wish to change( Overview/Single).
=> And the Field Type. Whether it is a key field or normal field.
Then the new field name changes to '+' sign, how can I give the appropriate name to the fields?
Please help!hello friend,
please follow this steps.
1. first u maintain filedlabels
2. then u can mainatin tmg k.
3. then save and activate k.
note : dont give field labes before generating tmg k
thanks ,
anji. -
Fieldname in not being displayed in the table maintenance
Hi Experts,
I have created a table maintenance for a custom table.The table contains 10 fields out of which first 3 are key fields.
on the 3rd key field i have supplied F4 help so as to populate the 4th field automatically based on the selection of 3rd field.
everything is working fine but last 6 'fieldname' is not being displayed on the column bar.instead of fieldname there is '+' sign on the column. And i have checked in layout(screen) also only first four fields being displayed.
plz help.
Thanks n Regards,
MukeshHello Mukesh,
As you know, data element or pre-defined data type will be assigned as field type to the fields in a table. If you are assigning the data element, then the data element has the option to give the field label.
If you are assigning the data element and the field label is empty, then + sign will come. In other case - if you assigning the pre-defined data type also, the screeen column header will be shown as + sign.
In both the above cases, you can change the column header manually in the layout.
Regards,
Selva K. -
Dynamic Column Names - Table Maintenance - SM31
Hey Everyone - I hope you are all having a good day )
Basically I have a custom Z table containing a number of different fields. I have created table maintenance for this table so it can be updated via SM31. This table is a generic mapping table that will be used for all mappings.
What I want to do is change the name of the columns based on x criteria when maintained in SM31. So for example.
The user chooses to edit line one, through SM31- for Company Code 123 - at this point I want to change the name of Columns 1 through 5 to relevant names for that Company Code. e.g A, B, C, D, E respectively. If the User chooses Company Code 567 then the names of Columns 1 through 5 will be something else. e.g. F, G, H, I, J respectively.
In the PBO of the overview screen I have implemented code to process this behaviour. From here I can hide fields etc etc. However I dont know where to change the actual Columns names to what I want them to be - i.e overwrite the Field Name coming in from the data element.
I would be very appreciative if anyone could help out on this. As always, thanks for taking the time to read this and I look forward to hearing from you.
Kind Regards
DamienWhen system generates the Table Maintenance, it creates LABEL (text fields) for the column heading in the table control and we can't control this labels from our program. These Label names are as like
*tablename-fieldname E.g. *ZTEST_TAB-FIELD1
So, you can replace these labels with Input Output Text field.
Make sure you give the same name as respective label's name.
Make these fields as "Output Only".
Now, you would be able to change the value of these fields from the PBO.
Word of caution: These of changes would go away if try to recreate the table maintenance.
Regards,
Naimesh Patel -
Delete data with table maintenance generator
Hi All,
I have created custom table ZXXX and table maintenance generator.
I need to maintain data but delete them too. I can update and modify data but how can I delete them ?
Thanks for your answers !
Best regards,
Sandrineok, I found ..
I created an internal table to delete the content of my table ZXXX :
DATA : ws_zxxx TYPE zxxx OCCURS 0 WITH HEADER LINE.
select * from zxxx into CORRESPONDING FIELDS OF TABLE ws_zxxx
DELETE zxxx from table ws_zxxx.
commit work.
it works !
thanks all ! -
Missing Date fields in table maintenance generation
I have some non-key date fields in my custom table and have noticed that they do not get generated on the overview screen of my two-step table maintenance dialog. They are present on the detail screen.
If I change the domain of the fields to CHAR they appear.
If I change the maintenance type to one-step they appear.
It seems it is standard behaviour for date fields to be omitted from the overview screen.
Can anyone confirm that this is standard behaviour or give an explanation for date fields being treated in this manner?...or come up with a way of including the fields on the header screen.
I already know that I can:
1. customize the screen to include the fields
2. create a non-date domain for the fields which uses date-type calendar dropdown
Thanks,
NeilThankyou Jonathan, I would have been too lazy to go into debug if I didn't have the form name you supplied! It wasn't the reason you suspected but it was failing the following check in that routine:
maintenance in list screen required?
CHECK p_tvdir-type = one_step_maint OR
( <w_dfies>-keyflag NE space "force only keyfields
OR ( 'CHARNUMC' CS <w_dfies>-datatype "and view char-fields
AND p_skip_fields = space )
OR ( 'CHARNUMC' CS <w_dfies>-datatype "and view char-fields
AND <w_dfies>-intlen GE 20 ) "int 3263961/2000
OR <w_dfies>-rollname = 'BEGDA' "time dependence
OR <w_dfies>-rollname = 'ENDDA' "time dependence
OR <w_dfies>-tabname NE p_gencb-viewname ). "or text table field
Because the datatype was DATS.......looks like it will only include key fields and CHAR, NUMC non-key fields or those with a rollname of BEGDA/ENDDA or texttable fields. In debug I changed the datatype to CHAR and it generated with my field included. I think there might be an OSS note to fix this but haven't found it yet. -
Table Maintenance Generator via program using ALV OO concept
Hi All,
I have a requriement to update the table using OO ALV i.e table maintenance generator program.
My Z table have three fields say.. NEW status, old status and flag.
I have to dispaly the records of the Z table in Matrix format.
for example the records of the Z table is
New status
Old status
Flag
N1
O11
F11
N1
O12
F12
N1
O13
F13
N2
O21
F21
N2
O22
F22
N2
O23
F23
N3
O31
F31
N3
O32
F32
N3
O33
F33
My program have to display the records of the table in matrix format i.e
| ..... | O11 | O12 | O13 | O21 | O22 | O23 | O31 | O32 | O33 | ..
| N1 | F11 | F12 | F13 | ..... | ..... | .... | ..... | ....... | .... | .. ____________________________________________________________________________________
| N2 | ..... | ...... | ....... | F21 | F22 | F23 | ... | ..... | ...... | .
| N3 | ...... | ..... | ....... . | ....... | ....... | .... | F31 | F32 | F33 |
The ALV display is dynamic i.e it depends upon the no. of records in the table...
My headings( Row heading and Column heading ) will be the value from table... and the user should be able to change the Flag ... For example when the user change the Flag 'F21' to say 'X',
| ..... | O11 | O12 | O13 | O21 | O22 | O23 | O31 | O32 | O33 | ..
| N1 | F11 | F12 | F13 | ..... | ..... | .... | ..... | ....... | .... | .. ____________________________________________________________________________________
| N2 | ..... | ...... | ....... | X | F22 | F23 | ... | ..... | ...... | .
| N3 | ...... | ..... | ....... . | ....... | ....... | .... | F31 | F32 | F33 | .
In the Z table the record is
N2 O21 F21
should be changed to
N2 O21 X
I tried using ALV oo concept....but I can able to display the output as like it is in table ....Not like the one above format....
Can you please help me to resolve it?
Thanx in advance
Sangeetha
Edited by: sangeetha s k on Dec 16, 2008 7:42 AM
Edited by: sangeetha s k on Dec 16, 2008 7:50 AM
Edited by: sangeetha s k on Dec 16, 2008 8:04 AMHi,
Go through Following Menu Path
Tcode SE11-> Table Name-> Change.
Utilities-> Table Maintance Generator->Create Maintance.
On Same Screen go to Menu Environment->Modification->Events
Create New Event e.g. 05 , Enter Form Routine Name.
Go to Editor.
and Put Your Logic
e.g.
FORM FILL_DEFAULT.
* Actual Logic for how to get materials list.
ENDFORM. -
Generate table maintenance dialog
Hi,
Hi created one table.
But it has one field ZCOUNT type NUMC with 10 and it is key. The other fields are one KEYFIELD type Char 10 positions, and others PARM1 until PARM17 type CHAR with 18 positions.
After I want one view for maintain this table.
I already have one view with the same name of the table and I created one transaction with transaction with variant.
Now starts my doubt, because I don't want to see the field ZCOUNT, but I want put values when SAVE/delete/change.
I know this should be done in SE54 with events, but How do I do this? Because I don't want to see this field, but when is new entry, I want save ZCOUNT with the total of records of table. And when is for delete one record, I need to fill this field with number of records of table.
Other things I don't want the text of the data element in the header, but another text like 'aaa' for parm1. Is this possible?
All helps are welcome.
Thanks in advanced.
Best regrads,
AnaHi Ana,
Is your view a 'maintenance view'? If so, then there is a column in there that you need to set it to 'H' for this field.
Go to SE11. Enter your view name in the view field. Choose 'Change'. Once you are inside, check if your view is a maintenance view(text right before your view name tells you the type). If not you need to change it to a maintenance view by choosing the "Change view type" under "Extras" in the menu.
Once your view is a maintenance view, then in the tab where you have the view fields, there is a column for "maintenance attribute for view field". Set this value to 'H' for ZCOUNT. This way it will not be displayed in the maintenance transaction(provided you have the maintenance through this view not through the table directly).
Then you can generate the "table maintenance generator module". Goto SE54 and use event 01 to fill this field.
Regards,
Srinivas -
Table maintenance by using module pool program
Hi
Please give me step by step procedure to generate table maintenance by using module pool programWhile creating table maintenance, you can go thro' the module pool program used for that.In that,in PBO part,just try making particular field active = 1 inside loop at screen.
Girish Kumar Lo...
Posts: 1,518
Questions: 2
Registered: 4/19/07
Forum points: 1,982
Re: Regarding Table maintanence generator
Posted: Jun 26, 2007 9:02 AM in response to: Younus Khan Reply E-mail this post
here is the code for that
REPORT ZTAB_MAINT
NO STANDARD PAGE HEADING
MESSAGE-ID ZZ.
T Y P E D E C L A R A T I O N S
*--Types declaration for selection to be passed as parameter into
*--VIEW_MAINTENANCE_CALL FM
TYPES: BEGIN OF TP_RANGETAB.
INCLUDE STRUCTURE VIMSELLIST.
TYPES: END OF TP_RANGETAB.
D A T A D E C L A R A T I O N S
DATA: V_MATNR TYPE MATNR, " Material Number
V_WERKS TYPE WERKS_D, " Plant
V_KONOB TYPE KONOB, " Product allocation object
V_ZCPLT(40) TYPE C. " Message
I N T E R N A L T A B L E D E C L A R A T I O N S
Internal table to subroutine code
*Internal table used as selection for VIEW_MAINTENANCE_CALL FM
DATA: IT_RANGETAB TYPE STANDARD TABLE OF TP_RANGETAB WITH HEADER LINE.
*--Internal table used for getting the tablefields
DATA: BEGIN OF IT_HEADER OCCURS 1.
INCLUDE STRUCTURE VIMDESC.
DATA: END OF IT_HEADER.
*--Name Tabel
DATA: BEGIN OF IT_NAMTAB OCCURS 50.
INCLUDE STRUCTURE VIMNAMTAB.
DATA: END OF IT_NAMTAB.
*--Used for handling 'BT' option
DATA: BEGIN OF IT_MATNR OCCURS 0,
MATNR TYPE MATNR,
END OF IT_MATNR.
*--Used for handling 'BT' option
DATA: BEGIN OF IT_WERKS OCCURS 0,
WERKS TYPE WERKS,
END OF IT_WERKS.
*--Used for handling 'BT' option
DATA: BEGIN OF IT_KONOB OCCURS 0,
KONOB TYPE KONOB,
END OF IT_KONOB.
*--Used for handling 'BT' option
DATA: BEGIN OF IT_ZCPLT OCCURS 0,
ZCPLT(40) TYPE C,
END OF IT_ZCPLT.
I N P U T S C R E E N
SELECTION-SCREEN BEGIN OF BLOCK SELSCR WITH FRAME TITLE TEXT-001.
RANGES: R_MATNR FOR V_MATNR.
RANGES: R_WERKS FOR V_WERKS.
RANGES: R_KONOB FOR V_KONOB.
RANGES: R_ZCPLT FOR V_ZCPLT.
Select Options
SELECT-OPTIONS: S_MATNR FOR V_MATNR NO-EXTENSION, " Material
S_WERKS FOR V_WERKS NO-EXTENSION, " Plant
S_KONOB FOR V_KONOB NO-EXTENSION,
" Product allocation object
S_ZCPLT FOR V_ZCPLT NO-EXTENSION. " Plant
SELECTION-SCREEN END OF BLOCK SELSCR.
A T S E L E C T I O N S C R E E N
AT SELECTION-SCREEN.
Validate user inputs
PERFORM FRM_VALIDATIONS.
S T A R T O F S E L E C T I O N
START-OF-SELECTION.
Fetch Data from Data Base
PERFORM FRM_GET_DATA.
S U B R O U T I N E S
*& Form frm_get_data
Call the function module VIEW_MAINTENNACE_CALL to get data
based on selection criteria
FORM FRM_GET_DATA .
CALL FUNCTION 'VIEW_GET_DDIC_INFO'
EXPORTING
VIEWNAME = 'ZTAB'
TABLES
X_HEADER = IT_HEADER
X_NAMTAB = IT_NAMTAB
SELLIST = IT_RANGETAB
EXCEPTIONS
NO_TVDIR_ENTRY = 1
TABLE_NOT_FOUND = 2.
IF SY-SUBRC <> 0.
MESSAGE E002 WITH 'Error in ZTAB table'(005).
ENDIF.
CLEAR: IT_RANGETAB,
IT_RANGETAB[].
LOOP AT IT_NAMTAB.
CASE IT_NAMTAB-VIEWFIELD.
WHEN 'MATNR'.
CLEAR IT_RANGETAB.
IT_RANGETAB-VIEWFIELD = 'MATNR'.
IT_RANGETAB-TABIX = SY-TABIX.
IT_RANGETAB-DDIC = IT_NAMTAB-READONLY.
LOOP AT S_MATNR.
CASE S_MATNR-OPTION.
WHEN 'EQ'.
IT_RANGETAB-AND_OR = 'AND'.
IT_RANGETAB-OPERATOR = 'EQ'.
IT_RANGETAB-VALUE = S_MATNR-LOW.
APPEND IT_RANGETAB.
WHEN 'BT'.
IT_RANGETAB-AND_OR = 'AND'.
IT_RANGETAB-OPERATOR = 'GE'.
IT_RANGETAB-VALUE = S_MATNR-LOW.
APPEND IT_RANGETAB.
IT_RANGETAB-AND_OR = 'AND'.
IT_RANGETAB-OPERATOR = 'LE'.
IT_RANGETAB-VALUE = S_MATNR-HIGH.
APPEND IT_RANGETAB.
WHEN 'NB'.
CLEAR: R_MATNR,
R_MATNR[].
R_MATNR-SIGN = 'I'.
R_MATNR-OPTION = 'BT'.
R_MATNR-LOW = S_MATNR-LOW.
R_MATNR-HIGH = S_MATNR-HIGH.
APPEND R_MATNR.
SELECT MATNR
INTO TABLE IT_MATNR
FROM ZTAB
WHERE MATNR IN R_MATNR.
DELETE ADJACENT DUPLICATES FROM IT_MATNR COMPARING MATNR
LOOP AT IT_MATNR.
IT_RANGETAB-AND_OR = 'AND'.
IT_RANGETAB-OPERATOR = 'NE'.
IT_RANGETAB-VALUE = IT_MATNR-MATNR.
APPEND IT_RANGETAB.
ENDLOOP.
WHEN 'NE'.
IT_RANGETAB-AND_OR = 'AND'.
IT_RANGETAB-OPERATOR = 'NE'.
IT_RANGETAB-VALUE = S_MATNR-LOW.
APPEND IT_RANGETAB.
WHEN OTHERS.
IT_RANGETAB-AND_OR = 'AND'.
IT_RANGETAB-OPERATOR = S_MATNR-OPTION.
IT_RANGETAB-VALUE = S_MATNR-LOW.
APPEND IT_RANGETAB.
ENDCASE.
ENDLOOP.
WHEN 'WERKS'.
CLEAR IT_RANGETAB.
IT_RANGETAB-VIEWFIELD = 'WERKS'.
IT_RANGETAB-TABIX = SY-TABIX.
IT_RANGETAB-DDIC = IT_NAMTAB-READONLY.
LOOP AT S_WERKS.
CASE S_WERKS-OPTION.
WHEN 'EQ'.
IT_RANGETAB-AND_OR = 'AND'.
IT_RANGETAB-OPERATOR = 'EQ'.
IT_RANGETAB-VALUE = S_WERKS-LOW.
APPEND IT_RANGETAB.
WHEN 'BT'.
IT_RANGETAB-AND_OR = 'AND'.
IT_RANGETAB-OPERATOR = 'GE'.
IT_RANGETAB-VALUE = S_WERKS-LOW.
APPEND IT_RANGETAB.
IT_RANGETAB-AND_OR = 'AND'.
IT_RANGETAB-OPERATOR = 'LE'.
IT_RANGETAB-VALUE = S_WERKS-HIGH.
APPEND IT_RANGETAB.
WHEN 'NB'.
CLEAR: R_WERKS,
R_WERKS[].
R_WERKS-SIGN = 'I'.
R_WERKS-OPTION = 'BT'.
R_WERKS-LOW = S_WERKS-LOW.
R_WERKS-HIGH = S_WERKS-HIGH.
APPEND R_WERKS.
SELECT WERKS
INTO TABLE IT_WERKS
FROM MARC
WHERE WERKS IN R_WERKS.
DELETE ADJACENT DUPLICATES FROM IT_WERKS COMPARING WERKS
LOOP AT IT_WERKS.
IT_RANGETAB-AND_OR = 'AND'.
IT_RANGETAB-OPERATOR = 'NE'.
IT_RANGETAB-VALUE = IT_WERKS-WERKS.
APPEND IT_RANGETAB.
ENDLOOP.
WHEN 'NE'.
IT_RANGETAB-AND_OR = 'AND'.
IT_RANGETAB-OPERATOR = 'NE'.
IT_RANGETAB-VALUE = S_WERKS-LOW.
APPEND IT_RANGETAB.
WHEN OTHERS.
IT_RANGETAB-AND_OR = 'AND'.
IT_RANGETAB-OPERATOR = S_WERKS-OPTION.
IT_RANGETAB-VALUE = S_WERKS-LOW.
APPEND IT_RANGETAB.
ENDCASE.
ENDLOOP.
WHEN 'KONOB'.
CLEAR IT_RANGETAB.
IT_RANGETAB-VIEWFIELD = 'KONOB'.
IT_RANGETAB-TABIX = SY-TABIX.
IT_RANGETAB-DDIC = IT_NAMTAB-READONLY.
LOOP AT S_KONOB.
CASE S_KONOB-OPTION.
WHEN 'EQ'.
IT_RANGETAB-AND_OR = 'AND'.
IT_RANGETAB-OPERATOR = 'EQ'.
IT_RANGETAB-VALUE = S_KONOB-LOW.
APPEND IT_RANGETAB.
WHEN 'BT'.
IT_RANGETAB-AND_OR = 'AND'.
IT_RANGETAB-OPERATOR = 'GE'.
IT_RANGETAB-VALUE = S_KONOB-LOW.
APPEND IT_RANGETAB.
IT_RANGETAB-AND_OR = 'AND'.
IT_RANGETAB-OPERATOR = 'LE'.
IT_RANGETAB-VALUE = S_KONOB-HIGH.
APPEND IT_RANGETAB.
WHEN 'NB'.
CLEAR: R_KONOB,
R_KONOB[].
R_KONOB-SIGN = 'I'.
R_KONOB-OPTION = 'BT'.
R_KONOB-LOW = S_KONOB-LOW.
R_KONOB-HIGH = S_KONOB-HIGH.
APPEND R_KONOB.
SELECT KONOB
INTO TABLE IT_KONOB
FROM T190
WHERE KONOB IN R_KONOB.
DELETE ADJACENT DUPLICATES FROM IT_KONOB COMPARING KONOB
LOOP AT IT_KONOB.
IT_RANGETAB-AND_OR = 'AND'.
IT_RANGETAB-OPERATOR = 'NE'.
IT_RANGETAB-VALUE = IT_KONOB-KONOB.
APPEND IT_RANGETAB.
ENDLOOP.
WHEN 'NE'.
IT_RANGETAB-AND_OR = 'AND'.
IT_RANGETAB-OPERATOR = 'NE'.
IT_RANGETAB-VALUE = S_KONOB-LOW.
APPEND IT_RANGETAB.
WHEN OTHERS.
IT_RANGETAB-AND_OR = 'AND'.
IT_RANGETAB-OPERATOR = S_KONOB-OPTION.
IT_RANGETAB-VALUE = S_KONOB-LOW.
APPEND IT_RANGETAB.
ENDCASE.
ENDLOOP.
WHEN 'ZCPLT'.
CLEAR IT_RANGETAB.
IT_RANGETAB-VIEWFIELD = 'ZCPLT'.
IT_RANGETAB-TABIX = SY-TABIX.
IT_RANGETAB-DDIC = IT_NAMTAB-READONLY.
LOOP AT S_ZCPLT.
CASE S_ZCPLT-OPTION.
WHEN 'EQ'.
IT_RANGETAB-AND_OR = 'AND'.
IT_RANGETAB-OPERATOR = 'EQ'.
IT_RANGETAB-VALUE = S_ZCPLT-LOW.
APPEND IT_RANGETAB.
WHEN 'BT'.
IT_RANGETAB-AND_OR = 'AND'.
IT_RANGETAB-OPERATOR = 'GE'.
IT_RANGETAB-VALUE = S_ZCPLT-LOW.
APPEND IT_RANGETAB.
IT_RANGETAB-AND_OR = 'AND'.
IT_RANGETAB-OPERATOR = 'LE'.
IT_RANGETAB-VALUE = S_ZCPLT-HIGH.
APPEND IT_RANGETAB.
WHEN 'NB'.
CLEAR: R_ZCPLT,
R_ZCPLT[].
R_ZCPLT-SIGN = 'I'.
R_ZCPLT-OPTION = 'BT'.
R_ZCPLT-LOW = S_ZCPLT-LOW.
R_ZCPLT-HIGH = S_ZCPLT-HIGH.
APPEND R_ZCPLT.
SELECT ZCPLT
INTO TABLE IT_ZCPLT
FROM ZTAB
WHERE ZCPLT IN R_ZCPLT.
DELETE ADJACENT DUPLICATES FROM IT_ZCPLT COMPARING ZCPLT
LOOP AT IT_ZCPLT.
IT_RANGETAB-AND_OR = 'AND'.
IT_RANGETAB-OPERATOR = 'NE'.
IT_RANGETAB-VALUE = IT_ZCPLT-ZCPLT.
APPEND IT_RANGETAB.
ENDLOOP.
WHEN 'NE'.
IT_RANGETAB-AND_OR = 'AND'.
IT_RANGETAB-OPERATOR = 'NE'.
IT_RANGETAB-VALUE = S_ZCPLT-LOW.
APPEND IT_RANGETAB.
WHEN OTHERS.
IT_RANGETAB-AND_OR = 'AND'.
IT_RANGETAB-OPERATOR = S_ZCPLT-OPTION.
IT_RANGETAB-VALUE = S_ZCPLT-LOW.
APPEND IT_RANGETAB.
ENDCASE.
ENDLOOP.
ENDCASE.
ENDLOOP.
IF S_ZCPLT[] IS INITIAL.
CALL FUNCTION 'VIEW_MAINTENANCE_CALL'
EXPORTING
ACTION = 'U'
VIEW_NAME = 'ZTAB'
TABLES
DBA_SELLIST = IT_RANGETAB
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.
ELSE.
CALL FUNCTION 'VIEW_MAINTENANCE_CALL'
EXPORTING
ACTION = 'U'
VIEW_NAME = 'ZTAB_ZTEST'
TABLES
DBA_SELLIST = IT_RANGETAB
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.
ENDIF.
ENDFORM. " frm_get_data
*& Form frm_validations
Validating field values
FORM FRM_VALIDATIONS .
Material number should not be validated (10/17/2005)
CLEAR V_MATNR.
SELECT SINGLE MATNR
INTO V_MATNR
FROM MARA
WHERE MATNR IN S_MATNR.
IF SY-SUBRC <> 0.
MESSAGE E002 WITH 'Material not found'.
ENDIF.
CLEAR V_WERKS.
SELECT SINGLE WERKS
INTO V_WERKS
FROM ZTAB
WHERE WERKS IN S_WERKS.
IF SY-SUBRC <> 0.
MESSAGE E002 WITH 'Plant (WERKS) not found'(002).
ENDIF.
CLEAR V_KONOB.
SELECT SINGLE KONOB
INTO V_KONOB
FROM ZTAB
WHERE KONOB IN S_KONOB.
IF SY-SUBRC <> 0.
MESSAGE E002 WITH ' Product allocation object not found'(003).
ENDIF.
CLEAR V_WERKS.
SELECT SINGLE WERKS
INTO V_WERKS
FROM ZTAB
WHERE WERKS IN S_ZCPLT.
IF SY-SUBRC <> 0.
MESSAGE E002 WITH 'Plant (ZCPLT) not found'(004).
ENDIF.
ENDFORM. " frm_validations
reward points if it is usefull ...
Regarding Table maintanence generator -
Help req for check customer table maintenance with XD02 if not throw error
hello ABAP GURUS,
check customer of the table maintenance with XD02 if not throw error i have given the codition for passing the values in the table but before that it has to check whether the customer i am passing in to the table is a customer from xd02.Here whatever no i am passing it is accepting it should not happen, but when i give the customer which is not a customer it should not accept but it has to throw the message as 'customer does not exist.Its urgent please help me
TYPES: BEGIN OF TY_KNVI,
KUNNR TYPE KUNNR,
TATYP TYPE TATYP,
TAXKD TYPE TAKLD,
END OF TY_KNVI.
DATA : VALIDFROM TYPE GUEBG,
VALIDTO TYPE GUEEN.
DATA : IT_KNVI TYPE STANDARD TABLE OF TY_KNVI,
WA_KNVI TYPE TY_KNVI OCCURS 0 WITH HEADER LINE.
DATA : V_NAME TYPE SYUNAME.
SELECT KUNNR
TATYP
TAXKD
FROM KNVI
INTO TABLE WA_KNVI
WHERE KUNNR = YYV_CFORM-KUNNR
AND TATYP = 'ZCST'
AND TAXKD = '1'.
V_NAME = SY-UNAME.
YYV_CFORM-ENTEREDBY = V_NAME.
IF SY-SUBRC NE 0.
MESSAGE E000(E4) WITH 'Please change the tax classification of ZCST as' '1' ', in Sales Area Data'.
ENDIF.
I have used the following code to enter the data into the table maintenance it is working fine and throwing the error when the tax type is not the one which i have given in the select statements but the problem is when i have given the customer no which is not there in the XD02 tcode, it is accepting and showing the error message as MESSAGE E000(E4) WITH 'Please change the tax classification of ZCST as' '1' ', in Sales Area Data'. now i have to check the customer no from XD02 and if it is existing in that tcode it should allow to save in the table maintenance otherwise throw a message as the 'Customer no does not exist, this I am unable to write so how can i check please help me .
thankx in advance.
Edited by: soni khadary on Apr 22, 2008 7:55 AMHi Kelly,
I guess <wa_tab>-handle_style is of type lvc_t_styl therefore you can do the following:
ls_edit-style = cl_gui_alv_grid=>mc_style_enabled.
"I assume you know your non-key fields' names so you can use subrotuine to perform update on each of them
ls_edit-fieldname = 'First field name' .
PERFORM update ls_edit.
ls_edit-fieldname = 'Second field name'.
PERFORM update ls_edit.
ls_edit-fieldname = 'Third field name'.
PERFORM update ls_edit
FORM update USING fs_edit type lvc_s_styl.
field-symbols: <style_tab> type lvc_t_styl,
<style_wa> type lvc_s_styl.
LOOP AT <tab> ASSIGNING <wa_tab>.
if e_row = sy-tabix .
"get you style table
assign component 'HANDLE_STYLE' of structure <wa_tab> to <style_tab>.
"as <style_tab> is typed fully you can read the row you are interested in
read table <style_tab> assigning <style_wa> with key fieldname = fs_edit-fieldname
if sy-subrc = 0.
"update this entry
<style_wa> = fs_edit.
* modify table <style_tab> from <style_wa>.
endif.
endif.
endloop.
endform.
Note!
Though, this should work, the use of RTTI as Uwe suggested would be best practise approach as far as dynamic programming is concerned. Anyhow it is still up to you which one you pick.
Regards
Marcin
I noticed now that this line is not necessary
modify table <style_tab> from <style_wa>.
as we simply are working with field symbols, so changes made to <style_wa> are already visible in that table <style_tab>.
Edited by: Marcin Pciak on Mar 15, 2009 12:44 PM -
Getting the original values in table maintenance and the new one and send t
Hello experts,
In table maintenance, I need to capture the original values in that selected column/field and
also the new one and send it to email. For example, I have a field in my z table named zaddress and whenever
the user changes the contents of that selected row I need to get/fecth the original value and the new and send it to email.
So the email will be something like this:
Dear Admin,
Changes were made to ztable. Here are the changes:
Customer : Customer 1
Order no : 1
Original Address : example address A
New Address : example address B
NOTE: Do not reply to this email.
Again, thank you guys and have a nice day!Hi Vijay,
<b>1</b>.
If u r using Modulepool programming to change the field contents ,u just capture field value into one variable .This is possible in <b>PBO</b>.before displaying .once u change the field value and press something ,now capture changed value in another variable .This is possible in <b>PAI</b>.After pressing something to modify Database.
I think u can get one idea after reading this .
<b>2</b>.
For sending mail it is not a problem.
You can check the following code.
*-------Mail related tables ,structures and variables
DATA:
w_subject LIKE sodocchgi1,
i_pack_list LIKE sopcklsti1 OCCURS 1 WITH HEADER LINE,
i_objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE,
i_contents_text LIKE solisti1 OCCURS 10 WITH HEADER LINE,
i_cont_bin LIKE solisti1 OCCURS 10 WITH HEADER LINE,
i_objhex LIKE solix OCCURS 10 WITH HEADER LINE,
i_receiver LIKE somlreci1 OCCURS 1 WITH HEADER LINE,
i_listobject LIKE abaplist OCCURS 1 WITH HEADER LINE,
pdf LIKE tline OCCURS 100 WITH HEADER LINE,
content_out LIKE solisti1 OCCURS 0 WITH HEADER LINE.
DATA:
tab_lines TYPE i,
doc_size TYPE i,
att_type LIKE soodk-objtp,
obj_desc LIKE w_subject-obj_descr,
sent_to_all LIKE sonv-flag,
client LIKE tst01-dclient,
name LIKE tst01-dname,
objtype LIKE rststype-type,
type LIKE rststype-type,
is_otf TYPE c ,
no_of_bytes TYPE i,
pdf_spoolid LIKE tsp01-rqident,
jobname LIKE tbtcjob-jobname,
jobcount LIKE tbtcjob-jobcount,
pn_begda LIKE sy-datum,
val(1) TYPE c,
pripar TYPE pri_params,
arcpar TYPE arc_params,
lay TYPE pri_params-paart,
lines TYPE pri_params-linct,
cols TYPE pri_params-linsz,
spool_name TYPE pri_params-plist.
CLEAR :w_subject,
sent_to_all,
i_pack_list[],
i_objhead[],
i_cont_bin[],
i_contents_text[],
i_receiver[].
i_cont_bin = ' | '.
APPEND i_cont_bin.
Subject of the mail.
obj_desc = 'Outstanding Appraisals' .
w_subject-obj_name = 'MAIL_ALI'.
w_subject-obj_descr = obj_desc.
Body of the mail
DATA :head_desc LIKE i_contents_text,
body_desc LIKE i_contents_text.
i_contents_text = space.
APPEND i_contents_text.
CLEAR i_contents_text.
CONCATENATE
'Please refer to the attached list of appraisal(s) that require your'
'attention. Please log in to the eHR System and use the eAppraisal'
'function to work on it.'
INTO body_desc
SEPARATED BY space.
i_contents_text = body_desc.
APPEND i_contents_text.
CLEAR i_contents_text.
CLEAR body_desc.
i_contents_text = 'Thank You.'.
APPEND i_contents_text.
CLEAR i_contents_text.
i_contents_text = space.
APPEND i_contents_text.
CLEAR i_contents_text.
CONCATENATE '(Note: This is system generated message, please'
'do not reply'
'to this Email.)'
INTO i_contents_text
SEPARATED BY space.
APPEND i_contents_text.
CLEAR i_contents_text.
Write Packing List (Body)
DESCRIBE TABLE i_contents_text LINES tab_lines.
READ TABLE i_contents_text INDEX tab_lines.
w_subject-doc_size = ( tab_lines - 1 ) * 255 + STRLEN(
i_contents_text ).
CLEAR i_pack_list-transf_bin.
i_pack_list-head_start = 1.
i_pack_list-head_num = 0.
i_pack_list-body_start = 1.
i_pack_list-body_num = tab_lines.
i_pack_list-doc_type = 'RAW'.
APPEND i_pack_list.
CLEAR i_pack_list.
Create receiver list
i_receiver-receiver = g_email_next_man.
i_receiver-rec_type = 'U'.
APPEND i_receiver.
CLEAR i_receiver.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = w_subject
put_in_outbox = 'X'
commit_work = 'X'
IMPORTING
sent_to_all = sent_to_all
TABLES
packing_list = i_pack_list
object_header = i_objhead
contents_bin = i_cont_bin
contents_txt = i_contents_text
receivers = i_receiver
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
IF sy-subrc NE 0.
ENDIF.
I think it helps u something.
<b>Thanks,
Venkat.O</b> -
How to use table maintenance view in module pool screen
hi ,
want to use table maintenance view in a module pool screen so that i can edit, insert, delete and update date in to the ztable.please help.You can simply call it via SM30. Or you can call the table maintence view from any program(report or module pool) using a function module.
call function 'VIEW_MAINTENANCE_CALL'
exporting
action = 'U'
view_name = 'Z_Table_Name'
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
others = 14.
Regards,
RIch Heilman -
Open T-code on double click of field in table maintenance
Hi Gurus,
I have one scenario, I have to show a transaction on double click event on a field of Table Maintence.
Please guide me in this .
Is there is any event in Table Maintenance Events to capture double_click of a field.
Regards,
Sowmen1. In the field attributes of the particular field there is a chechbox in display tab which says respond to double click, check that.
2. Assign the fuction code "PICK" for function code F2 in GUI status.
3.Now whenver you double click the field function code "PICK" gettes triggeed.
Now you can wrie yyou code based on this function code.
CASE sy-comm.
WHEN 'PICK'.
*If you want the name of the field and the value in that field use the below code.
GET CURSOR FIELD gv_field VALUE gv_cursor_value.
*DO your operation based on the field and the value.
ENDCASE.
Regards,
Smithesh -
How to use the table maintenance events for validating the input entries..?
Hi,
I have created a Z table with 6 fields in which all are KEY fields. All are of CHAR type. I have created the Table Maintenance Generator for the same. While maintaining the entries in the table, even though I maintain a blank entry for a field it is saving the entry. But, I don't want that way. All the fields are mandatory in my table. One should enter all the fields. Otherwise it should not allow to save the entry. So, I think it can be done using the Table Maintenance Events. can someone tell me how to use the Table Maintenance Events. and which event to use for my reuqirement and what is the logic to be written.
Or Is there any other way to solve my problem.
Please share your inputs. Thanks in advance.
Best regards,
paddu.In the table maintenance generator, Environment --> Modifications --> Events then a screen will be appear here,we need to create the Events.In the EVENTS screen, press new Entries, there give 01(Before Saving the Data in the Database) and give a name(This will become a PERFORM), then click the Editor pushbutton, this will be there at the right side of the entry, then a popup will be appear, you can create an include program, there inside of the include program write ur code.
Here is documentation for Event 01(Before Saving the Data in the Database )
Event 01: Before Saving the Data in the Database
Use
This event occurs before new, changed or deleted entries are written to the database. Other activities can be performed, for example:
hidden entry processing
fill hidden fields
flag data to be written to hidden tables after the database change.
To have the changes saved by the central maintenance dialog routines, SY-SUBRC must be set to 0 at the end of the routine.
Realization
This event has no standard routine. The following global data is available for the realization of the user routine:
internal table TOTAL
field symbols
field symbols <ACTION> and <ACTION_TEXT>
<STATUS>-UPD_FLAG
If internal table data are to be changed before saving, t he changes should be made in both the internal table TOTAL and in the internal table EXTRACT.
FORM abc.
DATA: F_INDEX LIKE SY-TABIX. "Index to note the lines found
LOOP AT TOTAL.
IF <ACTION> = desired constant.
READ TABLE EXTRACT WITH KEY <vim_xtotal_key>.
IF SY-SUBRC EQ 0.
F_INDEX = SY-TABIX.
ELSE.
CLEAR F_INDX.
ENDIF.
(make desired changes to the line TOTAL)
MODIFY TOTAL.
CHECK F_INDX GT 0.
EXTRACT = TOTAL.
MODIFY EXTRACT INDEX F_INDX.
ENDIF.
ENDLOOP.
SY-SUBRC = 0.
ENDFORM.
Regards,
Joy. -
How to create event in table maintenance generator
Hi guys,
I need to create an event for my table maintenace generator such that when the field land1 is filled, the landx field should take its data from t005t table. and the ladnx field should be display only, it can not be modified in table maintenance.
How can i create an event in table maint. gen? How am i going to do it?
thanks always,
markHi,
As mentioned in the last post go to the event screen by
Environment --> Modifications --> Events.
There you click on new entries and try writing your logic for event 21 i.e. after selecting 21 give some name of your event and write down the logic how you want to do this.
If event number 21 does not work then try 1. One of these two should work.
Hope this helps!!!
Regards,
Lalit
Maybe you are looking for
-
Two different apple ID's with purchased songs in one library
I have a user who had an ipod. Had several disks and 100 songs or so purchsed under email lets say [email protected], He then purchased an iphone and setup the phone under [email protected] on his work computer. He wanted his music on his work pc so
-
Calling subscreen on click of radio button
Hi, I am creating a module pool program , in which on click of a radio butto to 'YES' a subscreen should appear ( on the main screen) with few fields so that the user can input values of it. But I am having proble in calling the subscreen in PAI even
-
[NSFileHandle][Sockets] How to manage a network disconnection?
Hi, I have built a client/server app that communicates via TCP/IP. The *Client is an iPhone Application* that receives and sends many messages of variable sizes through a NSFileHandle object linked with a socket as its filedescriptor I catch *incomin
-
Resizing Image Window in Photoshop using Javascript
I write many scripts using the ScriptListener as my base for obtaining my scripts. One of the steps I need is to resize the Image window so I can properly place a logo on an image. When I resize the image using File>Automate>Fit Image. The Image Wind
-
Coonect Portal to External SQL Database
HI, I would like to link the portal to an external Sequel database, but could not find instructions on how to do this. Please post instructions on how to do this - thanks