‎2011 May 24 12:40 PM
Hi Experts,
The below metioned code, i am using in the BADI implemetation to get the screen values from transaction CURTO_CREATE.
But i am not able get the values of the screen fields.
Transacrion : CURTO_CREATE. system : ECC.
program name : CUSLNTRTO_CIF_REPORT.
if sy-tcode = 'CURTO_CREATE'.
move 'LOGSYS' to wa_dynpfields-FIELDNAME.
append wa_dynpfields to dynpfields.
clear wa_dynpfields.
move 'GP_SIMVE' to wa_dynpfields-FIELDNAME.
append wa_dynpfields to dynpfields.
clear wa_dynpfields.
call function 'DYNP_VALUES_READ'
exporting
dyname = 'CUSLNTRTO_CIF_REPORT'
dynumb = '1000'
translate_to_upper = 'X'
tables
dynpfields = dynpfields
exceptions
invalid_abapworkarea = 01
invalid_dynprofield = 02
invalid_dynproname = 03
invalid_dynpronummer = 04
invalid_request = 05
no_fielddescription = 06
undefind_error = 07.
endif.
In differnt ways i tried it ,like i passed sy-cprog instead of program name and with guiprogram also. but no use.
Note: In debug i noticed that its throwing exception 'dynname is invalid'.
Please suggest me..
Thanks..
‎2011 Jun 07 8:10 AM
Hello..
What happened, i didn't get any answer from forum.
Did i violate rules and regulations? If so please correct me.
Thanks
‎2011 Jun 07 8:10 AM
Hello..
What happened, i didn't get any answer from forum.
Did i violate rules and regulations? If so please correct me.
Thanks
‎2011 Jun 07 12:46 PM
Hi Phani,
Please try below code:
*data declaration for reading values given by user in the selection screen field.
DATA: BEGIN OF i_tab OCCURS 0.
INCLUDE STRUCTURE rsselread.
DATA: END OF i_tab.
MOVE: 'LOGSYS' TO i_tab-name,
'P' TO i_tab-kind. u201CP For parameter
APPEND i_tab.
MOVE: 'GP_SIMVE' TO i_tab-name,
'P' TO i_tab-kind. u201CCheck if field is Parameter
APPEND i_tab.
*move program name and screen number into local variable.
l_prog = sy-repid. u201C(Try by directly passing program name also)
l_dynnr = sy-dynnr. u201C(Try by directly passing Screen number also)
*calling function module to get the value given by user.
CALL FUNCTION 'RS_SELECTIONSCREEN_READ'
EXPORTING
program = l_prog
dynnr = l_dynnr
TABLES
fieldvalues = i_tab.
Hope this should slove your issue.
Thanks & Regards,
Gaurav.
‎2011 Jun 19 9:02 AM
Hi,
Thanks for your reply.
I tried with function RS_SELECTIONSCREEN_READ to read the values from the screen in BADI interface level ie while implementing the BADI related to 'CURTO_CREATE', t-code. But its not picking the values from the selection screen.
But we can use this function in normal reports, Because the SY-REPID is always same in reports.
Incase of interfaces the SY-REPID values cahnges to implementation name of BADI ......
And i tried by passing SY-CPROG but there is no use .. I think we cant use these functions in interface level.
If any other approch to read values from the screen into interface level, please suggest.
Thanks
‎2011 Jun 19 1:24 PM
Hi PHANI CHOWDARY,
What is certain is that your issue is not related to the BAdI, but to the context in which it runs (for example, you are in a different internal session).
By debugging from your BAdI, can you see the content of the parameters of program? Just enter variable name, as is :
(CUSLNTRTO_CIF_REPORT)LOGSYSIf it doesn't work it means you are not in the same internal session, so you'll have to choose another method to get the parameters (for example, by exporting them from the report, and importing them from your BAdI).
Note that in your current context, RS_SELECTIONSCREEN_READ is exactly the same as DYNP_VALUES_READ (the only case where you must use RS_SELECTIONSCREEN_READ is when you are handling the input help (F4) of a selection criterion in your own program using POV event).
BR
Sandra
‎2011 Jun 21 10:00 AM
Hi Sandra,
As you mentioned, i have checked the value of varable ' (CUSLNTRTO_CIF_REPORT)LOGSYS ', during debgging BADI. The variable holding some value( SCXCLNT700 ). So its in same internal session, but in function i didnot get any value.
Earlier i tried with export and import variable, that was working fine but disadvatage is need copy the standard program into custom program, in that we need to export variable to memory id and import it into BADI interface.
So, shall we conlude that 'the above functions are not useful in BADIs?' .
Thanks
‎2011 Jun 21 1:17 PM
Hi
So, shall we conlude that 'the above functions are not useful in BADIs?'
PLEASE STOP SAYING THAT, it's not related at all. This is not a BAdI issue, this is a context issue.
I guess sap_wiz is on the right track.
Could you tell us what is the name of the BAdI, and which method is it?
Sandra
‎2011 Jun 29 3:13 PM
Hi Rossi,
My intention to raise that question is not to highlight the usage of funtion, if we conclude on this we can make a note and move quickly in future.
Please note details:
T-code : CURTO_CREATE
BADI: CUSLNTRTO_ADDIN
Method : CHANGE_CIF_STRUCTURES.
System : ECC.
Thanks
‎2011 Jun 29 5:10 PM
Hi, you can use field-symbols:
FIELD-SYMBOLS: <fs> TYPE LOGSYS. "put here the correct type
DATA: zprogram(30).
zprogram = '(CUSLNTRTO_CIF_REPORT)LOGSYS'.
ASSIGN (zprogram) TO <fs>.
if you can read the value in debug mode you can use it, I did it a lot of times when these FM don't works... try and tell us...
‎2011 Jul 04 10:39 AM
Hi Husalban,
The piece of code is working fine using field symbols, so i am able get the details into BADI interface.
So no need to copy program to custom.
Thank you verymuch.
‎2011 Jun 21 10:06 AM
Hi, you intend to read teh values entered on screen.
The badi needs to be in the PAI of the screen, Where is it being called?
‎2011 Jun 21 11:32 AM
Hi,
After Key-in the values in the input screen of CURTO_CRETE, then only BADI will trigger, hence it is being called in the event PAI of the transction.
Thanks.
‎2011 Jun 21 11:47 AM
Hi,
Check for the FM/Class~method which is setting the data mentioned in reply above, just before call is made to BADI in standard program.
Similar way use the FM/Method in similar sequence in your development to set the parameter.
This should solve your issue.
Please intimate if the issue is resolved and what approach you took.
Thanks \Rahul.
‎2011 Jun 29 2:52 PM
Hi Rahul,
Thnks for your suggestion, but there no preceeding methods which are holding the required data. So i haven't approached this way.
I have achieved this requirement by export/import parameters. ie i copied the t-code to custom and chaned the code.
Thanks.