To insert a BR in a string char, use the following constant :
cl_abap_char_utilities=>cr_lf
Search tag : CrLf, retour chariot, ligne, newline, new, carriage return
To insert a BR in a string char, use the following constant :
cl_abap_char_utilities=>cr_lf
Search tag : CrLf, retour chariot, ligne, newline, new, carriage return
The method below enables to convert standard texts to string (with carriage returns). It can be useful when standard texts need to be changed or completed before being printed on Adobe forms.
(Otherwise, it is recommanded to use the standard text objet for Adobe forms).
Check program SAPHTML_EVENTS_DEMO.
Sample code :
PARAMETERS : p_field TYPE ztype AS LISTBOX VISIBLE LENGTH 25.
* If the ZTYPE has a domain with values, values will be autmatically
* displayed.
If your type has no values in domain or if you want to change the dropdown list values use FM VRM_SET_VALUES in initialization:
Read MoreTo hide a subform using javascript according a context node value in Adobe form :
// data.MAIN.SUBFORM_TO_HIDE::ready:form - (JavaScript, client)
var fieldToCheck= xfa.resolveNode("$record.MAIN.FIELD_VALUE");
if(fieldToCheck.value == null || fieldToCheck.value == "") {
this.presence = "hidden";
}
The goal here is to define of there are data into the table, if not, we hide the subform. That means, we hide the whole table (border and header line).
There are several ways to proceed, this is one :
Table from context is binded like :
Planned Independent Requirement (PIR) are managed through transaction MD6x.
(Do not confuse with Purchase infos records 😉)
FM to manage PIR with ABAP are :
The goal is to convert whatever time unit declared on system into hour in ABAP.
One way to proceed is to check table T006.
Filter dimension (DIMID) on ‘TIME’ to get only time unit and retrieve fields numerator (ZAEHL), denominator (NENNR) and exponent (EXP10) to get time in seconds.
According to your needs, you can use FM AIP9_STATUS_READ or FM STATUS_READ.
DATA : lv_objnr TYPE j_objnr,
lv_system_status TYPE j_stext, " (CHAR40)
lv_user_status TYPE j_stext. " (CHAR40)
CONCATENATE 'OR' gv_aufnr INTO lv_objnr.
CALL FUNCTION 'AIP9_STATUS_READ'
EXPORTING
i_objnr = lv_objnr
i_spras = sy-langu
IMPORTING
e_sysst = lv_system_status
e_anwst = lv_user_status.
This will return in each wa list of system and user external status (in requested language) separated by space.
DATA : lv_objnr TYPE j_objnr,
lt_status TYPE STANDARD TABLE OF jstat,
lv_status_schema TYPE j_stsma.
CONCATENATE 'OR' gv_aufnr INTO lv_objnr.
CALL FUNCTION 'STATUS_READ'
EXPORTING
objnr = lv_objnr
only_active = 'X'
IMPORTING
stsma = lv_status_schema
TABLES
status = lt_status
EXCEPTIONS
object_not_found = 1
OTHERS = 2.
This will return internal status id in LT_STATUS.
Read MoreYou can use the data element : UMC_Y_CONTENT.
Type RAWSRTING which has the same behavior as XSTRING.