C4C: Quickstart for UI Designer Scripting
Just a few random tricks how to work with the UI DEsigner scripts:
Just a few random tricks how to work with the UI DEsigner scripts:
To get the callstack in ABAP, simply call the following line:
DATA(lt_callstack) = cl_abap_get_call_stack=>format_call_stack_with_struct( cl_abap_get_call_stack=>get_call_stack( ) ).
Then you can access the callstack the same way you see it in the debugger, e.g. the name of the program will be in lt_callstack-progname.
The entities/properties of ODATA services are stored in the tables starting with /IWBEP/I_SBO_*
Example:
The project can be selected in plain text, but to get the properties of a specific entity, you need to enter by the NODE_UUID of the entity (from table /IWBEP/I_SBO_ET) in field PARENT_UUID of table /IWBEP/I_SBO_PR .
Just a quick note: If you're looking to see in one place how the common operations such as read, create, save, rollback are done via BOL, look at how SAP is doing it in method CL_BOL_OBJECT_BROWSER=>ON_USER_COMMAND.
This is called when you click any of the buttons in the BOL Repository browser (TX GENIL_BOL_BROWSER).
First of all, this blog contains some of the steps required to configure pricing. But in case it goes away, I'm listing the steps here as well.
First item of note is that not all the steps in the blog are actually required, e.g. if your access sequence does not use product, you don't need to maintain anything at the product level. And some of the steps were missing (at least in my case).
Quick note: if you're trying to find out what's going on with your BPATH statement and you want to debug the traversal thereof, the central entrypoint is method CL_WCF_BPATH_PARSER=>STATUSMACHINE. This splits the string and acts on the segments.
Method CL_WCF_BPATH_PARSER=>PROCESS_ACTION is then called to delegate processing of the different segment types to different methods.
I sometimes come across standard code that looks like it may make my life easier, but I'm not sure how.
BREAK-POINT ID <...> is a statement like that:
If you want to remove messages from a CRM order and you want the message to be removed at the database level (not only at the UI level), for instance, to be able to remove errors that prevent you from creating a follow-up document (follow-up documents can only be created from error-free documents), you may find the following code snippet useful:
Note that the following is using function modules because the BOL layer does not provide the appropriate method calls:
In WebUI, say you have a search attribute OBJECT_ID that is labelled "Object ID" on the UI search screen. How do you retrieve that label "Object ID" at runtime (i.e. to output an error message for mandatory field check)?
Simply call
me->get_possible_fields( ).
inside the implementation class methods (i.e. DO_PREPARE_OUTPUT etc.)
BTW, in all other contexts, to get the text representation of a technical field (say you are reading field communication type, and the technical value (result of get_property_as_string()) is TEL) simply call
I've recently faced the requirement to retrieve the BP in the manager role (head) of an orgs parent org. In CRM, you can use function module RH_STRUC_GET to do just that: Supply it with a starting point (BP, central person, position or org unit) and it will do its work according to the evaluation path given.