Field Update workflow action - Updating today's date into a field
Hello there.
I was hoping someone might be able to help with an error currently being experienced with regards to this workflow action.
The requirement is for a workflow rule to action the printing of today's date into a custom field on an Activity record. The workflow rule condition is (PRE('<Status>') <> 'Completed') AND ([<Status>] = 'Completed'). This appears to be working and triggering the action correctly.
The custom field to be updated is of type 'Date'. The value being updated into this field is 'Today()'. Overwrite existing values is checked.
The default value for the field is also 'Today()'. Thus the workflow action involves overwriting the default value (i.e. the date the record was created) to the current date when the Status is switched to completed.
When the workflow is triggered the following error message occurs:
"Unable to evaluate workflow rule for the following reason:
Update [Custom field name] : The value '01/18/2008' cannot be converted to a date time value. (SBL-DAT-00359) (SBL-ODS-00500)"
One odd observation is that this error only occurs when trying to update activities that were created on previous days - (it will not overwrite the default value of 15/01/2008 with 18/01/2008). The workflow does not return an error message when asked to overwrite a value which is equal to itself (i.e. if the default value was 18/01/2008, the workflow runs without error, although the value stays the same as you would expect.)
Can anyone shed any light on this? One potential thought is that our CRM is set up so that all dates appear in a different format - i.e. dates appear as dd/mm/yyy, rather than mm/dd/yyyy. Could this be contributing to this issue?
Any help very much appreciated indeed.
Thanks,
Kieran
ps. The reason for doing all this is that 'Completed date' for an activity does not appear in reporting. This has been raised with Oracle and apparently an 'enhancement request' has been registered.
Guys,
using the following statement, it does display the current system time
Mid(Timestamp(),4,2)+'-'+Mid(Timestamp(),1,2)+'-'+Mid(Timestamp(),7,4)+' '+Mid(Timestamp(),12,8)
Now When i do this , it displays me a time which is 3 hours ahead
Mid(Timestamp(),4,2)+'-'+Mid(Timestamp(),1,2)+'-'+Mid(Timestamp(),7,4)+' '+Mid(Timestamp() + (3.0/24.0),12,8)
My problem is to now display the difference of the current time stamp and the the time which shows 3 hours ahead in one field
Thats is substracting the first timestamp syntax fro mthe second timestamp syntax
and ofcourse if I copy paste both the syntaxes and put a minus sign in between, it doesnt work
Timestamdiff is not allowed in workflows or field validations :(
Anyone has any ideas?
Nick
Similar Messages
-
Parsing today's date into a String
How can I parse today's date into a String using this format: dd.mm.yyyy??? I taken a look at SimpleDateFormat, but I couldn't figure it out...
Herman SvensenHi Herman
this is copied from the api docs:
// Format the current time.
SimpleDateFormat formatter
= new SimpleDateFormat ("yyyy.MM.dd G 'at' hh:mm:ss a zzz");
Date currentTime_1 = new Date();
String dateString = formatter.format(currentTime_1);
http://java.sun.com/j2se/1.3/docs/api/java/text/SimpleDateFormat.html
So what is the problem to figure out? -
How to update the last date into DSO?
Hi,all,
When I do grouping in a transformation from DSO1 to another DSO2 ,which means I will make three(for example) records from dso1 into one record in dso2 by using a higher level key in DSO2. I will sum the keyfigure quantity of DSO1, but using the last date of the field posting date in DSO1 to update DSO2. I could write a routing to achieve this.
But the question is, how can I make sure the three records are in one datapackge to through my routing?since the packages are excute in transformation one by one? If not,how can I update for the field of last date? And since I use sum to keyfigure,the sematic groups function in DTP can not be used.
I'm very anxious about it.Hope someone could help me.Thank you.hi,darshak,
Could you explain a little bit more? I'm still not clear enough how to do that.
Thank you for your reply. -
Insert Today's Date into query
I created a query and want it to filter based on todays date. How do I automatically add todays date to the query so the user does not need to type it in?
Yes you are right. You will need to use WHERE convert(varchar, T0.refdate, 103) = convert(varchar, getdate(), 103)
This is because the getdate() is actually a datetime field and returns current date and current time so in the previous statement you are asking for journal fields where the posting date = todays date AND the exact time that the query is run which is never going to be true.
If you just use getdate()-1 you will also get yesterdays' journals posted after this time yesterday. -
Workflow Action to update Picklist field
Hi,
I created a workflow. I want the workflow to do the following.
Workflow Conidtion*
If Condition is PM20 Bid Decision or PM20 No Bid then perform workflow actions.
[<plMileston_ITAG>]=LookupValue("OCC_CUST_LOV_OPTY_6", "PM020 Bid Decision") OR [<plMileston_ITAG>]=LookupValue("OCC_CUST_LOV_OPTY_6", "PM020 No Bid Decision")
Workflow Action*
FieldValue('<plProject_Category_ITAG>')=LookupValue("OCC_CUST_LOV_OPTY_2", "A")
I tried various combinations of using FieldValue,Just by putting the FieldName = A. Nothing works..I know the workflow Condition is working because when I update a free form text I am able to append the field. When I try to update a Picklist (Editable) it does not work. Dont know the reasons.
Also what is the standard way of updating a Picklist field using workflow.
Thanks for your help in advance
GautamHi !
I assume you created a workflow with the event trigger *"Before modified record saved"*.
Then you action Update values must be :
Field Name : select the picklist you want to update
Value : simply put LookupValue("OCC_CUST_LOV_OPTY_2", "A")
Overwrite Existing Values : check the box it if you want your picklist updated even if already filled
You don't have to repeat the fieldname in the value field of your action. It seems that you put FieldValue('<plProject_Category_ITAG>')= in the value field, but with that, it will not work.
Hope this will help, feel free to ask more !
Max -
Update the data into the ZTABLE fields thru program logic ..?
hi all,
i have ZTABLE1,ZTABLE2,ZTABLE3, and this tables like ALV grids using object methods.
in the same table fields now i wanted to update the data into the ZTABLE fields thru program logic .
could anyone please help me ....
please provide if anyone of have any program logic that would be helpfull to me.
thanks in advance...
srinivas....Hi Srinivas,
The following statements are used to upload the data into custom tables.
1. Modify
2. Update
3. Insert
if you are using OO ALV, you should enable the 'SAVE' button in the main toolbar. if the user press the save button, then you should upload the data to the custom table.
please find the example code, in this example 'PERFORM F_SAVE_DATA'(here i gave the message only, you write your own logic here) is used to save the data in custom table.
Report Program: ZB_ALVOOPS_TEST
Line:-----
REPORT ZB_ALVOOPS_TEST MESSAGE-ID ZCR_MESSAGES.
Top Include - Global Data Declaration *
INCLUDE ZB_ALVOOPS_TEST_TOP.
SEL Include - Selection Screen *
INCLUDE ZB_ALVOOPS_TEST_SEL.
AT SELECTION SCREEN *
Initialization Event *
INITIALIZATION.
Initialize Screen Number.
PERFORM F_INITIALIZE.
Initialize Field Catalog for ALV Grid.
PERFORM F_INITIALIZE_GRID.
END-OF-SELECTION.
Call Display Screen *
CALL SCREEN 9000.
Event Handler - Class Definition and Implementation *
INCLUDE ZB_ALVOOPS_TEST_CL01.
PBO Event - Module Implementation *
INCLUDE ZB_ALVOOPS_TEST_PBO.
PAI Event - Module Implementation *
INCLUDE ZB_ALVOOPS_TEST_PAI.
Subroutine Include *
INCLUDE ZB_ALVOOPS_TEST_F01.
Include: ZB_ALVOOPS_TEST_TOP
Line:-------
Type Declaration For Internal Tables *
Collection Data
TYPES: BEGIN OF TY_MARA ,
MATNR TYPE MATNR , " Material
VPSTA TYPE VPSTA , " Maintenance status of complete material
MTART TYPE MTART , " Material Type
MBRSH TYPE MBRSH , " Industry Sector
MATKL TYPE MATKL , " Material Group
BISMT TYPE BISMT , " Old material number
MEINS TYPE MEINS , " Base Unit of Measure
BSTME TYPE BSTME , " Order unit
BRGEW TYPE BRGEW , " Gross weight
MAKTX TYPE MAKTX , " Material Description
ROWCOLOR TYPE CHAR4 , " Row Color
END OF TY_MARA .
Flag *
DATA: FG_REFRESH TYPE XFLD , " Used to Refresh ALV
FG_SAVE TYPE XFLD . " Data Saved Or Not.
Internal Table Declaration *
DATA: IT_MARA TYPE STANDARD TABLE OF TY_MARA , " Internal table for Material
WA_MARA TYPE TY_MARA . " Workarea for Material
Variable Declaration For General Constants *
CONSTANTS: C_SCREEN_SELECT TYPE SYDYNNR VALUE '9001' , " Selection Screen Number
C_SCREEN_SELECT_NIL TYPE SYDYNNR VALUE '9002' , " Empty Screen Number
C_STATUS9000 TYPE CHAR10 VALUE 'STATUS9000' , " PF-Status
C_TITLEBAR TYPE CHAR4 VALUE '9000' , " Title Bar
C_ISSUE_CONTAINER TYPE SCRFNAME VALUE 'WORKCONTAINER', " Container Name (Screen Painter)
C_BUTTON_TYPE TYPE CHAR1 VALUE '3' , " Button Type
C_EXECUTE TYPE CHAR4 VALUE 'SELE' , " Functions 'SELE' -> Execute
C_BACK TYPE CHAR4 VALUE 'BACK' , " Functions 'BACK' -> Back to main screen
C_ENTER TYPE CHAR5 VALUE 'ENTER' , " Functions 'ENTER' -> No Action
C_SEL01 TYPE CHAR5 VALUE 'SEL01' , " Functions 'SEL01' -> Toggle Function
C_SAVE TYPE CHAR4 VALUE 'SAVE' , " Functions 'SAVE' -> Save Function
C_REFRESH TYPE CHAR7 VALUE 'REFRESH' , " Functions 'REFRESH' -> Clear and Fres All objects
C_ADD_MI TYPE CHAR6 VALUE 'ADD_MI' , " Functions 'ADD_MI' -> Add New Media Issue
C_TRUE TYPE CHAR1 VALUE 'X' , " Set X value
C_REQUIRED TYPE CHAR1 VALUE '1' , " Un-Confirmed Qty field obligatory or not.
C_INPUT TYPE CHAR1 VALUE '0' , " Reason field should not be input.
C_ALV_SAVE TYPE CHAR1 VALUE 'A' , " ALV
C_ERROR TYPE CHAR1 VALUE 'E' , " Error Type
C_SIGN TYPE CHAR1 VALUE 'I' , " Sign
C_OPTION TYPE CHAR2 VALUE 'EQ' , " Option.
C_COMMIT_WAIT TYPE CHAR1 VALUE '5' , " Waiting to update in DB
C_TABNAME TYPE CHAR1 VALUE '1' , " Parameter (ALV)
C_CANCEL TYPE CHAR1 VALUE 'N' , " Cancel
C_YES TYPE CHAR1 VALUE 'J' . " Yes.
Variable Declaration For Container and ALV Grid *
DATA: OBJ_CUST_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER , " Container Class
OBJ_CUST_GRID TYPE REF TO CL_GUI_ALV_GRID . " ALV Grid Class
Field Catalog Declaration For Container and ALV Grid *
DATA: IT_FIELDCAT TYPE LVC_T_FCAT , " Field Catalog
IT_EXCLUDE TYPE UI_FUNCTIONS , " Standard Function Exclude from ALV
WA_FIELDCAT TYPE LVC_S_FCAT , " For Field Catalog
WA_LAYOUT TYPE LVC_S_LAYO . " ALV Layout
Global Variable Declaration *
DATA: OK_CODE TYPE SY-UCOMM , " OK CODE ( Screen Attribute Don't Change the var.name)
G_SAVE_CODE TYPE SY-UCOMM , " OK CODE
G_ANSWER TYPE CHAR1 , " OK or Cancel.
G_SELECTION_DYNNR TYPE SYDYNNR , " Screen Number
G_ERROR_TEXT TYPE CHAR128 , " Error Text
G_SELECTION_TOGGLE_TEXT TYPE CHAR50 , " Toggle Text, Value: Hide Selection, Show Selection
G_MATNR TYPE MATNR , " Material
G_SMATNR TYPE MATNR , " Material
G_SMTART TYPE MTART . " Material Type
Include: ZB_ALVOOPS_TEST_SEL
Line:-------
Selection Screen
SELECTION-SCREEN BEGIN OF SCREEN 9001 AS SUBSCREEN .
SELECTION-SCREEN BEGIN OF BLOCK SELECTION WITH FRAME TITLE TEXT-001 .
SELECT-OPTIONS: S_MATNR FOR G_SMATNR , " Material
S_MTART FOR G_SMTART . " Material Type
SELECTION-SCREEN END OF BLOCK SELECTION .
SELECTION-SCREEN END OF SCREEN 9001 .
Empty Selection
SELECTION-SCREEN BEGIN OF SCREEN 9002 AS SUBSCREEN .
SELECTION-SCREEN BEGIN OF BLOCK SELECTION_NIL WITH FRAME TITLE TEXT-002 .
Nil
SELECTION-SCREEN END OF BLOCK SELECTION_NIL .
SELECTION-SCREEN END OF SCREEN 9002 .
Include: ZB_ALVOOPS_TEST_CL01
Line:-------
CLASS lcl_event_handler DEFINITION *
Event Handler Class Definition *
CLASS LCL_EVENT_HANDLER DEFINITION.
PUBLIC SECTION.
METHODS:
HANDLER_TOOLBAR FOR EVENT TOOLBAR OF CL_GUI_ALV_GRID
IMPORTING E_OBJECT E_INTERACTIVE ,
HANDLER_USER_COMMAND FOR EVENT USER_COMMAND OF CL_GUI_ALV_GRID
IMPORTING E_UCOMM .
ENDCLASS. "lcl_event_handler DEFINITION
CLASS lcl_event_handler IMPLEMENTATION *
Event Class Implementation. *
CLASS LCL_EVENT_HANDLER IMPLEMENTATION.
Toolbar -----Create 'Add Issue' button
METHOD HANDLER_TOOLBAR.
DATA: L_WA_TOOLBAR TYPE STB_BUTTON. " Toolbar
CLEAR: L_WA_TOOLBAR.
Button Type
L_WA_TOOLBAR-BUTN_TYPE = C_BUTTON_TYPE . " 3.
APPEND L_WA_TOOLBAR TO E_OBJECT->MT_TOOLBAR.
Add Issue Button.
CLEAR: L_WA_TOOLBAR.
L_WA_TOOLBAR-FUNCTION = 'ADD_MI' . " 'ADD_MI' .
L_WA_TOOLBAR-ICON = 'ICON_CREATE'.
L_WA_TOOLBAR-QUICKINFO = 'CREATE' . " 'Add Issue'.
L_WA_TOOLBAR-TEXT = 'CREATE' . " 'Add Issue'.
L_WA_TOOLBAR-DISABLED = ''.
APPEND L_WA_TOOLBAR TO E_OBJECT->MT_TOOLBAR.
CLEAR: L_WA_TOOLBAR.
ENDMETHOD. "handler_toolbar
User Actions Events-- Handle 'Add Issue' Button Click.
METHOD HANDLER_USER_COMMAND.
CASE E_UCOMM.
Add Issue Button.
WHEN C_ADD_MI.
IF NOT G_MATNR IS INITIAL.
FG_REFRESH = C_TRUE.
PERFORM F_ADD_MEDIAISSUE.
ENDIF.
ENDCASE.
Refresh Control
CALL METHOD CL_GUI_CFW=>FLUSH
EXCEPTIONS
CNTL_SYSTEM_ERROR = 1
CNTL_ERROR = 2
OTHERS = 3.
Handle Exceptions
IF SY-SUBRC <> 0.
CASE SY-SUBRC.
WHEN 1.
G_ERROR_TEXT = TEXT-026. " 'Control System Error'.
WHEN 2.
G_ERROR_TEXT = TEXT-027. " 'Control CL_GUI_CFW Has Raised Error'.
ENDCASE.
MESSAGE G_ERROR_TEXT TYPE 'E'.
ENDIF.
Refresh Alv Grid.
PERFORM F_REFRESH_GRID.
ENDMETHOD. "handler_user_command
ENDCLASS. "lcl_event_handler IMPLEMENTATION
Object Ref. Event Class.
DATA: OBJ_EVENT_HANDLER TYPE REF TO LCL_EVENT_HANDLER.
Include: ZB_ALVOOPS_TEST_PBO
Line:----
Module STATUS_9000 OUTPUT *
Set PF-Status *
MODULE STATUS_9000 OUTPUT.
PF Status
SET PF-STATUS C_STATUS9000 .
SET TITLEBAR C_TITLEBAR .
ENDMODULE. " STATUS_9000 OUTPUT
Module Create_Alvgrid OUTPUT *
Create Or Refresh ALV Grid *
MODULE CREATE_ALVGRID OUTPUT.
PERFORM F_PROCESS_ALV .
PERFORM F_REFRESH_GRID.
ENDMODULE. " create_alvgrid OUTPUT
Include: ZB_ALVOOPS_TEST_PAI
Line:----
Module exit_command INPUT *
Exit Command ( Cancel and Exit ) *
MODULE EXIT_COMMAND INPUT.
LEAVE PROGRAM.
ENDMODULE. " exit_command INPUT
Module user_command_9000 INPUT *
User Command - Process toolbar Events *
MODULE USER_COMMAND_9000 INPUT.
Take an Action based on user Input
G_SAVE_CODE = OK_CODE.
CLEAR OK_CODE.
CASE G_SAVE_CODE.
Back
WHEN C_BACK .
Raise the Confirmation Message When User not saved the data.
IF FG_SAVE = C_YES.
PERFORM F_EXITCHECK CHANGING G_ANSWER .
IF G_ANSWER = C_YES.
PERFORM F_SAVE_DATA.
ELSE.
CLEAR G_SAVE_CODE.
ENDIF.
CLEAR: FG_SAVE.
ENDIF.
LEAVE PROGRAM.
Enter
WHEN C_ENTER.
Execute ( F8 )
WHEN C_EXECUTE .
IF IT_MARA IS INITIAL.
PERFORM F_SELECTMATERIAL.
ENDIF.
Toggle Button
WHEN C_SEL01.
PERFORM F_TOGGLE_SELECTION_SCREEN. " USING ok_code.
SAVE ( CTRL+S )
WHEN C_SAVE.
IF NOT G_MATNR IS INITIAL.
PERFORM F_SAVE_DATA.
CLEAR: G_MATNR.
ENDIF.
New Entry ( CTRL+F1 )
WHEN C_REFRESH.
PERFORM F_REFRESH_DATA.
ENDCASE.
ENDMODULE. " user_command_9000 INPUT
Include: ZB_ALVOOPS_TEST_F01
Line:----
Form f_toggle_selection_screen *
Toggle Function - Hide Selection / Show Selection *
FORM F_TOGGLE_SELECTION_SCREEN.
Toggle Function
IF G_SELECTION_DYNNR = C_SCREEN_SELECT.
G_SELECTION_DYNNR = C_SCREEN_SELECT_NIL.
G_SELECTION_TOGGLE_TEXT = TEXT-902.
ELSE.
G_SELECTION_DYNNR = C_SCREEN_SELECT.
G_SELECTION_TOGGLE_TEXT = TEXT-901.
ENDIF.
ENDFORM. " f_toggle_selection_screen
Form f_initialize
Initialize Screen Number and Text
FORM F_INITIALIZE .
Initialize Screen Number
G_SELECTION_DYNNR = C_SCREEN_SELECT.
G_SELECTION_TOGGLE_TEXT = TEXT-901.
ENDFORM. "f_initialize
Form f_selectmaterial *
FORM F_SELECTMATERIAL .
Select the data from Mara Table
SELECT A~MATNR
A~VPSTA
A~MTART
A~MBRSH
A~MATKL
A~BISMT
A~MEINS
A~BSTME
A~BRGEW
B~MAKTX
INTO TABLE IT_MARA
FROM MARA AS A INNER JOIN MAKT AS B ON AMATNR = BMATNR
WHERE A~MATNR IN S_MATNR
AND A~MTART IN S_MTART
AND B~SPRAS = 'EN'.
IF SY-SUBRC = 0.
FG_REFRESH = C_TRUE.
FG_SAVE = C_YES .
G_MATNR = C_TRUE.
LOOP AT IT_MARA INTO WA_MARA WHERE BRGEW >= 200.
WA_MARA-ROWCOLOR = 'C310'.
MODIFY IT_MARA FROM WA_MARA.
ENDLOOP.
ELSE.
MESSAGE 'No data Found' TYPE 'E'.
ENDIF.
ENDFORM. " f_selectmaterial
Form f_initialize_grid *
Initialize Field Catalog. *
FORM F_INITIALIZE_GRID .
field catalog
PERFORM F_ATTRFCAT USING :
'MATNR' '1' '0' TEXT-005 '15' '0' 'X' ' ' ' ',
'VPSTA' '1' '1' TEXT-006 '15' '0' 'X' ' ' ' ',
'MTART' '1' '2' TEXT-007 '15' '0' ' ' ' ' ' ',
'MBRSH' '1' '3' TEXT-008 '15' '0' ' ' ' ' ' ',
'MATKL' '1' '4' TEXT-009 '15' '0' ' ' 'X' ' ',
'BISMT' '1' '5' TEXT-010 '15' '0' ' ' ' ' ' ',
'MEINS' '1' '6' TEXT-011 '15' '0' ' ' ' ' ' ',
'BSTME' '1' '7' TEXT-012 '15' '0' ' ' ' ' ' ',
'MAKTX' '1' '8' TEXT-013 '15' '0' ' ' ' ' 'C711',
'BRGEW' '1' '9' TEXT-014 '15' '0' ' ' ' ' ' '.
Set Editable Fields in ALV.
PERFORM F_SETEDIT_FIELDS CHANGING IT_FIELDCAT.
ENDFORM. "f_initialize_grid
Form f_setedit_fields *
Set Editable Fields in ALV *
C_IT_FIELDCAT <-- Field Catalog *
FORM F_SETEDIT_FIELDS CHANGING C_IT_FIELDCAT TYPE LVC_T_FCAT.
Local Variable Declaration.
DATA: LS_FIELDCAT LIKE LINE OF C_IT_FIELDCAT. " Field Catalog
Create Editable Fields.
LOOP AT C_IT_FIELDCAT INTO LS_FIELDCAT.
CASE LS_FIELDCAT-FIELDNAME.
WHEN 'BRGEW'.
LS_FIELDCAT-EDIT = C_TRUE.
WHEN 'MAKTX'.
LS_FIELDCAT-EDIT = C_TRUE.
ENDCASE.
MODIFY C_IT_FIELDCAT FROM LS_FIELDCAT.
ENDLOOP.
ENDFORM. " f_setedit_fields
Form f_attrfcat *
Update Field Catalog Internal Table *
U_FIELDNAME --> Field Name *
U_ROW_POS --> Row Position *
U_COL_POS --> Column Position *
U_SELTEXT_L --> Display Column Heading *
U_OUTPUTLEN --> Heading Output Length *
U_DECIMALS_OUT --> Number of decimal places in output *
U_KEY --> Key in ALV Display *
U_FIX --> Existence of fixed values *
FORM F_ATTRFCAT USING
U_FIELDNAME TYPE SLIS_FIELDNAME
U_ROW_POS TYPE SYCUROW
U_COL_POS TYPE SYCUCOL
U_SELTEXT_L TYPE SCRTEXT_L
U_OUTPUTLEN TYPE OUTPUTLEN
U_DECIMALS_OUT TYPE CHAR1
U_KEY TYPE CHAR1
U_FIX TYPE VALEXI
U_COL_COLOR TYPE LVC_EMPHSZ.
Update field catalog.
WA_FIELDCAT-FIELDNAME = U_FIELDNAME.
WA_FIELDCAT-ROW_POS = U_ROW_POS.
WA_FIELDCAT-COL_POS = U_COL_POS.
WA_FIELDCAT-COLTEXT = U_SELTEXT_L.
WA_FIELDCAT-SELTEXT = U_SELTEXT_L.
WA_FIELDCAT-OUTPUTLEN = U_OUTPUTLEN.
WA_FIELDCAT-DECIMALS_O = U_DECIMALS_OUT.
WA_FIELDCAT-KEY = U_KEY.
WA_FIELDCAT-VALEXI = U_FIX.
WA_FIELDCAT-EMPHASIZE = U_COL_COLOR.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
ENDFORM. "ATTR_FCAT
Form f_refresh_data *
Clear All the objects used in the program ( Data Related ) *
FORM F_REFRESH_DATA .
Clear All the Objects Used in Our Program.
CLEAR: S_MATNR ,
S_MTART ,
IT_MARA ,
OK_CODE ,
FG_REFRESH ,
FG_SAVE ,
G_SAVE_CODE ,
G_MATNR .
FREE: S_MATNR ,
S_MTART ,
IT_MARA ,
OK_CODE ,
FG_REFRESH ,
FG_SAVE ,
G_SAVE_CODE ,
G_MATNR .
Refresh Alv.
FG_REFRESH = C_TRUE.
ENDFORM. " f_refresh_data
Form f_process_alv *
1. Create Custom Container *
2. Create ALV Grid *
3. Exclude Standard Functions *
4. Display the ALV *
5. Register the Events. *
FORM F_PROCESS_ALV .
Display ALV
Custom Container
IF OBJ_CUST_CONTAINER IS INITIAL.
CREATE OBJECT OBJ_CUST_CONTAINER
EXPORTING
CONTAINER_NAME = C_ISSUE_CONTAINER.
ALV Grid
IF OBJ_CUST_GRID IS INITIAL.
CREATE OBJECT OBJ_CUST_GRID
EXPORTING
I_PARENT = OBJ_CUST_CONTAINER.
ENDIF.
Exclude Standard Functions
PERFORM F_EXCLUDETOOLBAR USING OBJ_CUST_GRID
CHANGING IT_EXCLUDE.
Layout.
WA_LAYOUT-CWIDTH_OPT = C_TRUE.
WA_LAYOUT-INFO_FNAME = 'ROWCOLOR'.
ALV Grid Display
CALL METHOD OBJ_CUST_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IS_LAYOUT = WA_LAYOUT
IT_TOOLBAR_EXCLUDING = IT_EXCLUDE
I_SAVE = C_ALV_SAVE
CHANGING
IT_FIELDCATALOG = IT_FIELDCAT[]
IT_OUTTAB = IT_MARA.
ENDIF.
Register Editable ALV Events
CALL METHOD OBJ_CUST_GRID->REGISTER_EDIT_EVENT
EXPORTING
I_EVENT_ID = CL_GUI_ALV_GRID=>MC_EVT_MODIFIED
EXCEPTIONS
ERROR = 1
OTHERS = 2.
*Create Object for Custom Event Handler Class if the ref. object is
*initial.
IF OBJ_EVENT_HANDLER IS INITIAL.
CREATE OBJECT OBJ_EVENT_HANDLER.
ENDIF.
Register Events
SET HANDLER: OBJ_EVENT_HANDLER->HANDLER_TOOLBAR FOR
OBJ_CUST_GRID,
OBJ_EVENT_HANDLER->HANDLER_USER_COMMAND FOR
OBJ_CUST_GRID.
Set Toolbar
CALL METHOD OBJ_CUST_GRID->SET_TOOLBAR_INTERACTIVE.
ENDFORM. " f_process_alv
Form f_excludetoolbar *
Exclude Standard Functions from ALV *
U_OBJ_CUST_GRID --> Instant for CL_GUI_ALV_GRID *
C_IT_EXCLUDE <-- Internal table for Exclude *
FORM F_EXCLUDETOOLBAR USING U_OBJ_CUST_GRID TYPE REF TO CL_GUI_ALV_GRID
CHANGING C_IT_EXCLUDE TYPE UI_FUNCTIONS.
Exclude Standard Functions
CLEAR: C_IT_EXCLUDE.
APPEND U_OBJ_CUST_GRID->MC_FC_CHECK TO C_IT_EXCLUDE.
APPEND U_OBJ_CUST_GRID->MC_FC_REFRESH TO C_IT_EXCLUDE.
APPEND U_OBJ_CUST_GRID->MC_FC_LOC_COPY TO C_IT_EXCLUDE.
APPEND U_OBJ_CUST_GRID->MC_FC_LOC_COPY_ROW TO C_IT_EXCLUDE.
APPEND U_OBJ_CUST_GRID->MC_FC_LOC_CUT TO C_IT_EXCLUDE.
APPEND U_OBJ_CUST_GRID->MC_FC_LOC_DELETE_ROW TO C_IT_EXCLUDE.
APPEND U_OBJ_CUST_GRID->MC_FC_LOC_APPEND_ROW TO C_IT_EXCLUDE.
APPEND U_OBJ_CUST_GRID->MC_FC_LOC_INSERT_ROW TO C_IT_EXCLUDE.
APPEND U_OBJ_CUST_GRID->MC_FC_LOC_MOVE_ROW TO C_IT_EXCLUDE.
APPEND U_OBJ_CUST_GRID->MC_FC_LOC_PASTE TO C_IT_EXCLUDE.
APPEND U_OBJ_CUST_GRID->MC_FC_LOC_PASTE_NEW_ROW TO C_IT_EXCLUDE.
APPEND U_OBJ_CUST_GRID->MC_FC_LOC_UNDO TO C_IT_EXCLUDE.
ENDFORM. " f_excludetoolbar
Form f_create_returnrequest *
Create Return Request based on the Work container ( ALV Grid Data) *
FORM F_CREATE_RETURNREQUEST.
Message to save
ENDFORM. " f_create_returnrequest
Form f_add_mediaissue *
Create New Media Issue if the user click 'ADD ISSUE' Button. *
1. Get the Input From User *
2. Get Total Delivery and Return Quantity *
3. Append to Final internal table *
FORM F_ADD_MEDIAISSUE .
Local Variable Declaration.
MESSAGE 'Add Button Clicked' TYPE 'I'.
ENDFORM. " f_add_mediaissue
Form f_refresh_grid *
Refresh ALV Grid *
FORM F_REFRESH_GRID .
Refresh ALV Grid.
IF FG_REFRESH IS NOT INITIAL.
CALL METHOD OBJ_CUST_GRID->REFRESH_TABLE_DISPLAY.
CLEAR: FG_REFRESH.
ENDIF.
ENDFORM. " f_refresh_grid
Form f_getcollectissue *
FORM F_GETCOLLECTISSUE .
Collection Plan Data
ENDFORM. " f_getcollectissue
Form f_perpare_final *
FORM F_PERPARE_FINAL .
Perpare Final Internal table
ENDFORM. " f_perpare_final
Form f_validate_data *
FORM F_VALIDATE_DATA.
Message if any data validation.
ENDFORM. " f_validate_data
Form f_modify_final *
Update Actual Delivery Qty and Return Qty in Final Internal table *
Form f_save_data *
Save the Data When User Click 'Save' Button *
FORM F_SAVE_DATA .
Message
MESSAGE 'Save Button Clicked' TYPE 'I'.
ENDFORM. "f_save_data
Form f_exitcheck *
When User Exit from the Transaction then Raise Confirmation message*
C_ANSWER <-- OK or Cancel. *
FORM F_EXITCHECK CHANGING C_ANSWER TYPE CHAR1.
Security Check.
C_ANSWER = C_CANCEL.
CALL FUNCTION 'POPUP_TO_CONFIRM_DATA_LOSS'
EXPORTING
TITEL = TEXT-039
IMPORTING
ANSWER = C_ANSWER.
ENDFORM. "f_exitcheck
Screen Numer : 9000
Line:------
PROCESS BEFORE OUTPUT.
MODULE STATUS_9000.
CALL SUBSCREEN: SELECTIONSCREEN INCLUDING SY-CPROG G_SELECTION_DYNNR.
MODULE CREATE_ALVGRID.
PROCESS AFTER INPUT.
MODULE EXIT_COMMAND AT EXIT-COMMAND.
CALL SUBSCREEN: SELECTIONSCREEN.
MODULE USER_COMMAND_9000.
pls reward if it is useful -
How to update pick up date (VBAK-ABHOD) field in sales order
I am creating sales orders using BAPI_SALESORDER_CREATEFROMDAT2 but it is not updating VBAK-ABHOD field i .e pick up date. Is there any FM which updates the pick up date VBAK-ABHOD also.
I need to update pick up date for a special type of sales orders (Delivery orders) which are created in reference to schedule agreement.
Is there any other way we can update pick up date. My last option is BDC but donot want to use it.
Thanks in Advance.
Rajesh.Hi Rajesh,
You can not find any field in BAPI Change Or Create for sales order even header change BADI is for SAP Modification only. The best way to code in form USEREXIT_MOVE_FIELD_TO_VBAP in MV45AFZZ, orelse you can use CALL TRANSACTION Method.
Please let me know if you have any issues.
Thanks and regards, -
Hello,
A field in a list is called 'Date' (it is a date/time type of field)
Now I want a condition in a workflow that checks the 'date' field. If the date is less than X days from today it should (for example) send an email to a certain user.
Is this kind of condition possible in a SharePoint Designer Workflow?
Thanks in advance!Hi,
As I understand, you want to create a workflow that can check data.
The workflow can be:
1. Add 0 months, 2 days, 0 hours, 0 minutes to Current Item:date1 (Output to Variable: date ) (2 days is the days you can set, and Current Item:data1 is the datefield you want to check from today)
2. Add 0 months, 0 days, 0 hours, 0 minutes to Today (Output to Variable: date1 )
3. Set time as 0 : 0 for Variable: date (Output to Variable: date2 )(get the Variable: date Date only )
4. Set time as 0 : 0 for Variable: date1 (Output to Variable: date3 )( get the Variable: date1 Date only)
5. If Variable: date2 equals Variable: date3
6. Email these users
https://onedrive.live.com/redir?resid=40B702A9FB117DD!136&authkey=!ABtMg5n3OtPakCg&v=3&ithint=photo%2cPNG
More reference:
http://stackoverflow.com/questions/1249366/start-sharepoint-workflow-x-days-before-expiry-date
Best regards,
Sara Fan -
Workflow Action: Trouble adding a new line in "Description" field.
Hi folks. I'm really having a difficult time with this one and it seems so simple...
I am struggling with how to get a field update action to enter a line break in a note field. I've tried "\n", "\n\r", "chr(13)", "chr(10)", "<br>" and so on.... it just puts the text of what I use into the Description.
Here's the simplified workflow action...
[<NextStep>] + "\ \n" + PRE('<Description>')
What it's supposed to do.. is every time someone updates the field [<NextStep>], I want to replace the contents of the description field with the new value for nextstep (plus a new line) and then followed by everything that was in the description field previously. This way I have a running log in the description field.
Idealy it should put:
Today() + ": " + [<NextStep>] + <line break> + PRE('<Description>')
but when I add the Today() it ignores everything that follows. I'm not as worried about that as I am about the inablity to put in the line beak. Please help!!!
Thanks!
Edited by: ThinkGadget on May 11, 2009 9:13 AM because the forum interpreted the "\\n"
Edited by: ThinkGadget on May 11, 2009 9:15 AM (I put a space between the two back slashes so that the forum doesn't interpret it as a new line)I had used the "\\n" in my expressions to add a new line in the Description field. Only issue is also add a \ to the end of line but that was acceptable in my case. We are on OOD R16.
-
Data load error during updation of master data
Dear all,
While updating the master data from the PSA , the following error is appearing and the load fails.
"The time interval ['20050313'/'20050313'] & (from/to) for the data
records 1 & and 2 & overlaps in characteristic 0EQUIPMENT &."
What could be the reason for this error and how to correct the same.
I am able to understand that the valid from and the valid to date are same. in R/3 whenever a change record is created for the equipment the valid from and the valid to date will be the same as shown below.
Creation of record (for example today) valid from :- 02.06.2008 and valid to 31.12.9999.
Change of record (for example tommorrow) Valid from :- 03.06.2008 and valid to 31.12.9999
In the above case the valid to date of the creation data will automatically change from 31.12.9999 to 03.06.2008.
How could this be solved.
Regards,
M.MHi Magesh,
Please look at /BIC/*Equipment table in SE16.
Find the record with a key = ********* and notice what values have Date_from and Date_to fields. The interval they determine, overlap with ur date_to and date_from.
You need to supply correct date_to & date_from values.
thanks
Assign points if this helps
Note: this is a common scenario in time dependendent master data.....it happens because you have two records for the same values of master data and also they have overlapping time interval.....you cannot have two values of master data at the same time. -
Specific Due Date Syntax for Create Task Workflow Action
I'm looking for a formula which will create a monthly due date on a specific day of the month (ie 1st or 15th). I have figured out a way to create recurring activities through workflows by adding a recuurence picklist but I currently only have monthly recurrences as Today()+30 which works but is not as clean as a monthly task that occurs on the 15th of every month.
Record Type=Activity
Event=When modified record saved
Workflow condition=FieldValue('<Type>')='To Do' AND FieldValue('<plRecurrence_ITAG>')='Every 30 days' AND FieldValue('<Status>')='Completed'
Actions=Create Task
Recurrence picklist is a required field and is chosen be the end user upon creation of the original activity (Type=To Do). The duplicate activity is created upon completion (see condition) and now the end user has a recurring task due 30 days out. this future task has the recurrence in the subject (since the recurrence field cannot be defined in the workflow action) and the end user is prompted by the system to complete the activity record (choose a recurrence) upon trying to save the record as complete or by clicking the "Mark as completed" button. Thus the cycle is repeated.
All I'm trying to figure out is instead of having the formula [<DueDate>]+30 in the Due Date* field within the create task workflow action, I'd like a formula that can choose a specific day of the month. I've tried combinations of cast, concat, timeframe, month, year...expressions to give me the date value I'm looking for (ie 4/15/2011) but I can't get the syntax to work. all I need is that syntax that can provide a specific date (4/15/2011) derived from the due date. -
Trying to have today's date dynamically entered into a repeating table row textfield when the button is clicked to create each repeating row. The user can then enter addtional text into the same text field next to the date.
Example:
[4/25/2012] This is the text the user entered.
Today's date is populated in each update row created when the "Update Row" button is clicked.
The following script works but only for the first instance, not the second, third, forth, etc...
Click event: (JavaScript, client)
this.resolveNode('Table2._RowB').addInstance(1);
xfa.resolveNode("Table2.RowB.#subform.Update").rawValue
Thank you,
~DonHi Don,
Does this solution cover the above problem? https://acrobat.com/#d=VjJ-YsXLKmV6QU84JrAAIw
Niall -
I've been running multiple monitors for over a year on my Macbook. Updated today to Lion OSx and well Steve, it didn't just work. My macbook will not detect my three external monitors, and after scouring the last hour on Google of how to remedy this and trying the basic suggestions of restarting, unplugging, replugging, to no avail. Anyone else have a similar problem since they've upgraded to Lion OSx?
karl219 wrote:
1-Time machine seems to be coming up often in the discussions.If my backup is on my external hard drive, why would space be taken up on my macbook hard drive?
Read the first extract for the definition of backup snapshots and how they are handled by the OS.
2-Shoud I delete older backups? If for example, all I need from Time Machine is the latest backup done today, can I get rid of the 2+ yeras of backups, or do they not take up that much space?
No. Time Machine should be on a separate HDD and will take care of deleting backups when necessary on that drive.
3-Back to the issue, considering I don't have access to a an apple store for the next few months, what is my best plan of action?
I would consider installing a larger internal HDD. Capacities to 1 TB are now available.
4-I am considering buying a new macbook 15inch, and get more space, however, I'm scared that the same problem will happen again. Is this common on all macs? Will using Time Machine to "Restore" my backups bring along the issues as well?
All Macs using Time Machine will experience the same conditions. The problem is that many users do not under stand what 'Other' is and that leads to confusion. There are many essential OS files in that category that should not be touched as well as some user files. The issue is not to reduce 'Other' as such, but reduce the total amount of data on the HDD if space is becoming a premium.
Please read these two extracts:
http://pondini.org/OSX/LionStorage.html
http://pondini.org/OSX/DiskSpace.html
Ciao. -
Error While updating Process form data Using Scheduler
Hi All,
I am trying to update Process form data (ex : lastname) using a scheduled task Code. I am getting Error while updating Field.
Code :
HashMap<String, String> map = new HashMap<String, String>();
map.put("UD_EBS_PF_LASTNAME", "lastname");
formintf.setProcessFormData(instancekey, map); //I AM GETTING AT THIS LINE
Saying
Thor.API.Exceptions.tcAPIException: The following required fields have not been given values:EBS IT Resource : The following required fields have not been given values:EBS IT Resource
at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:234)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:348)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:259)
at Thor.API.Operations.tcFormInstanceOperationsIntfEJB_h6wb8n_tcFormInstanceOperationsIntfRemoteImpl_1036_WLStub.setProcessFormDatax(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:85)
at $Proxy2.setProcessFormDatax(Unknown Source)
at Thor.API.Operations.tcFormInstanceOperationsIntfDelegate.setProcessFormData(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at Thor.API.Base.SecurityInvocationHandler$1.run(SecurityInvocationHandler.java:68)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.security.Security.runAs(Security.java:41)
at Thor.API.Security.LoginHandler.weblogicLoginSession.runAs(weblogicLoginSession.java:52)
at Thor.API.Base.SecurityInvocationHandler.invoke(SecurityInvocationHandler.java:79)
at $Proxy3.setProcessFormData(Unknown Source)
at com.wyndham.tasks.AssignRandomPasswordToAllUsersSchedulerTest.execute(AssignRandomPasswordToAllUsersSchedulerTest.java:182)
at com.wyndham.tasks.AssignRandomPasswordToAllUsersSchedulerTest.main(AssignRandomPasswordToAllUsersSchedulerTest.java:63)
Caused by: Thor.API.Exceptions.tcAPIException: The following required fields have not been given values:EBS IT Resource : The following required fields have not been given values:EBS IT Resource
at com.thortech.xl.ejb.beansimpl.tcFormInstanceOperationsBean.setProcessFormData(tcFormInstanceOperationsBean.java:761)
at com.thortech.xl.ejb.beansimpl.tcFormInstanceOperationsBean.setProcessFormData(tcFormInstanceOperationsBean.java:426)
at Thor.API.Operations.tcFormInstanceOperationsIntfEJB.setProcessFormDatax(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)Is that possible there was the field ZDATE in your form interface/ context and now it is not? I guess some source has changed so the field in the form (binding to the not existing field) cannot be processed. Otto
-
Update 100 Row Data In One Time against a Code
Dear Expert,
How can I update a Master Data Row Table record using a particular code. Like I write a query Update Table Set U_UDF = 'Value' Where Code = 2
U_UDF is the field of Master Data Row Table's field. There are 100 Row against code 2 & I want to update all row with same value but in one time only.
How can I do that ?
Plz help me.
RegardsHi,
Try this:
SAPbobsCOM.GeneralService oGeneralService = null;
SAPbobsCOM.GeneralData oGeneralData = null;
SAPbobsCOM.GeneralDataParams oGeneralParams = null;
SAPbobsCOM.CompanyService sCmp = null;
SAPbobsCOM.GeneralData oChild = null;
SAPbobsCOM.GeneralDataCollection oChildren = null;
sCmp = SBO_Company.GetCompanyService();
oGeneralService = sCmp.GetGeneralService("UDO");
// Get UDO record
oGeneralParams = ((SAPbobsCOM.GeneralDataParams)(oGeneralService.GetDataInterface(SAPbobsCOM.GeneralServiceDataInterfaces.gsGeneralDataParams)));
oGeneralParams.SetProperty("Code", ContractCode);
oGeneralData = oGeneralService.GetByParams(oGeneralParams);
// Add lines on UDO Child Table
oChildren = oGeneralData.Child("CONTRACTDETAIL");
// Update an existing line
oChild = oChildren.Item(LineId - 1);
DateTime dt = DateTime.Now;
oChild.SetProperty("U_STATS", "Terminated");
oChild.SetProperty("U_Updated", dt);
oChild.SetProperty("U_Remarks", "Service Terminated");
//Update the UDO Record
oGeneralService.Update(oGeneralData);
I have given you the sample. Just change it accordingly.
Hope it helps.
Thanks & Regards
Ankit Chauhan
Maybe you are looking for
-
My iPad fell and damage a litle part of the aluminium cover
It damaged a smal part of the speakers area but works fine. Does any one jnows the repair or replace price of the cover? regards
-
Hi, Was testing out the find myac and it set the (Enter your system lock PIN code to unlock this Mac) now I can't unlock it. Any one have any ideas how I can unlock it.
-
Dreamweaver MX 2004 Loading Trouble
I have dreamweaver MX 2004 that does not load on my powerbook g4. I have re-installed with negative results. It appears to load; however, a small window error window appears without any error message and the only option is "ok" which upon click exits
-
Changing the tuning of the tuner
Hi everyone This could be an extremely thick question, but I thought I'd ask it after checking the forums here with no luck. I've just downloaded Fogerty's 'Proud Mary' lesson and he begins (in the advanced mode) to talk about the tuning of the guita
-
Assignment of Payroll Data to BW Month- 0HR_PY_1
We wish to extract data from R/3 payroll for both the IN Period and FOR period for the same country code.. Does anybody currently do this and what are the options available thanks Rodd