‎2015 Jun 22 1:46 PM
HI ABAPers,
Is there a way to pass parameters to the following identifiers in a message longtext/ documentation?
DS:TRAS - Link to transaction and skip first screen
DS:REPN - Online execution of report with parameter selection
DS:REPO - Online execution of report
Thanks,
Juwin Pallipat Thomas
‎2015 Jun 22 3:30 PM
There is a way to pass the values to the underlying called object.
For Transaction DS:TRAN, you can pass the values using the parameter ID. The syntax would be
<DS:TRAN.MM03(MAT.&SYST-MSGV1&)>Material Master</>
MAT is the material parameter ID
The values is being passed in the message variable &SYST-MSGV1& -- The message is (Material &1 has low stock.).
So, calling message with this sample, TEST_NP would be sent to MM03:
DATA: lv_matnr TYPE mara-matnr.
lv_matnr = 'TEST_NP'.
MESSAGE i002(z_testmessage) WITH lv_matnr.
For reports DS:REPO, you would need to use the variant to send the value.
<DS:REPO.RM07DOCS.VARI1>Material Documents</>
RM07DOCS is the report
VARI1 is the variant, separated by a dot
To use this, you can create the temporary variant in the report using the variant FMs and delete it after the message is issued.
Regards,
Naimesh Patel
‎2015 Jun 22 2:27 PM
Hello Juwin,
Can you please explain the requirement clearly ??
‎2015 Jun 22 2:56 PM
While defining a long text for a message, I can insert a link to a transaction or report in the text. But, how can pass parameters from the message, to the linked transaction/ report?
For eg. The message short text may say "Application log 121312421412313 created. To view the complete log, click here". I want the link to directly point to the log messages, not requiring the users to copy-paste the log number to the external transaction.
How can this be done?
Thanks,
Juwin Pallipat Thomas
‎2015 Jun 22 3:30 PM
There is a way to pass the values to the underlying called object.
For Transaction DS:TRAN, you can pass the values using the parameter ID. The syntax would be
<DS:TRAN.MM03(MAT.&SYST-MSGV1&)>Material Master</>
MAT is the material parameter ID
The values is being passed in the message variable &SYST-MSGV1& -- The message is (Material &1 has low stock.).
So, calling message with this sample, TEST_NP would be sent to MM03:
DATA: lv_matnr TYPE mara-matnr.
lv_matnr = 'TEST_NP'.
MESSAGE i002(z_testmessage) WITH lv_matnr.
For reports DS:REPO, you would need to use the variant to send the value.
<DS:REPO.RM07DOCS.VARI1>Material Documents</>
RM07DOCS is the report
VARI1 is the variant, separated by a dot
To use this, you can create the temporary variant in the report using the variant FMs and delete it after the message is issued.
Regards,
Naimesh Patel
‎2015 Jun 22 3:51 PM
Hi Naimesh,
I tried doing what you suggested. But, got the attached error.
DS:REPO syntax check was OK. Only DS:TRAN failed.
Thanks,
Juwin
‎2015 Jun 22 3:55 PM
‎2015 Jun 29 2:34 PM
Hi Naimesh,
Although the solution worked, I found that there is a limitation to this (DS:TRAN). Length of [ Tcode + Parameter ID + Value + 3 ] cannot be more than 20 characters. If it is more than 20 chars, the value of variable l_dokname is cut off.
Thanks,
Juwin
‎2015 Jun 29 2:57 PM
Yes, you are correct that it can't be more than 20 although the FM TRAN_OBJECT_SHOW is able to handle that length up to 60 characters (PERFORM SET_PARAMETER).
MOVE STRING TO STR.
DO 60 TIMES.
ADD 1 TO COUNT_DO.
MOVE STR+COUNT_DO(1) TO BYTE.
IF BYTE EQ LB.
Can you handle the same requirement via REPS?
Regards,
Naimesh Patel
‎2015 Jun 29 3:18 PM
Hi Naimesh,
For my scenario, I will have to create many temporary variants to use REPS option, which I don't prefer to do. Anyways, once I found out about the limitation, I am redesigning my program a little bit, to handle this.
Thanks,
Juwin
‎2015 Jun 29 3:36 PM
Or you can use the custom Identifier in the documentation and have a custom class to handle the event.
To achieve it, try like this:
You can pass up to 4 variables which you can pass via SY-MSGV* variables as the key. You can have your own syntax for the ZTRA key. I was thinking something like this:
<DS:ZTRA.MMBE.MAT=&SYST-MSGV1&.WRK=&SYST-MSGV2&.CHG=&SYST-MSGV3&>Call MMBE</>This way you can split the key at dot and get all the parts. First would be the Transaction name. For rest, split at = to get the parameter ID and the value. Set the Parameter IDs with relevant keys and do the call transaction.
You can also have one more key ZTRS to skip the initial screen in call transaction.
Regards,
Naimesh Patel
Updated points 2 & 3 (with 4 & 5) as they were incorrect.
‎2015 Jul 14 2:13 PM
Created an article to include this solution : ABAP Overcome Long Text Links Handling using Custom Class
For Report, you can use the static parameter with table type RSPAR. Set the values before the message and use the same parameter in SUBMIT statement within the ZREP.
Regards,
Naimesh Patel
‎2015 Jul 14 2:26 PM
Set the values before the message and use the same parameter in SUBMIT statement within the ZREP.My situation is:
Invoice output triggers a program for some subsequent processing. From that program, I need to store results in an application log and add a message in the output message processing log saying 'Application log xxxx created'. Once the user goes into the invoice and double clicks on that message from the processing log, there should be a link which will take him to the application log directly.
Since the message is not thrown from my own program, I cannot set the parameter values from my program, before the application log display is called.
Thanks,
Juwin
‎2015 Jul 14 3:14 PM
To suit your requirement, you can create a new custom doctype say ZLOG and handle that in the event handler.
This is my message:
"Processing log for Invoice &1 generated in application log &2.
MESSAGE I003(Z_TEST) with '123' '778501'.
I'm passing the billing document in SYST-MSGV1 and application log in SYST-MSGV2.
In the long text, add this new doc type
<DS:ZLOG.V1=&SYST-MSGV1&.V2=&SYST-MSGV2&>click to see log</>
Now in the event handler class, create a new method ZSHOW_LOG and call in the RESOLVE_LINK.
CASE doc_link+3(4). when 'ZLOG'.
|
The method SHOW_LOG would split the parts and obtain the application log number and invoice number. Call FM APPL_LOG_DISPLAY_WITH_LOGNO to display the log.
METHOD zshow_log.
|
Regards,
Naimesh Patel
‎2015 Jul 14 3:20 PM
Yep, that's almost similar to what I ended up doing. But, didn't create a new doctype. I used a custom parameter id to pass the invoice number to my custom transaction.
Thanks,
Juwin