0

How can i retrieve the is_sfparam-content, either using query or function module.

then will be passed as a parameter to cl_recp_data_cn_general=>get_contract. do you have any idea? Where can I get that is_sfparam-content?

Thanks

CALL METHOD cl_recp_data_cn_general=>get_contract
  EXPORTING
    id_guid     = is_sfparam-content
  IMPORTING
    es_contract = contract
  CHANGING
    cf_error    = lf_error.
Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Dumbest666
  • 47
  • 3
  • 13
  • Look at the tables: `DOCGUID` or `SFDOCGUID`, field `DOCGUID` or `SFDOCGUID` for the latter. – Jagger Aug 15 '19 at 09:23
  • 1
    The import parameter `id_guid` is asking for a 'Globally Unique Identifier' aka GUID. You use a GUID when you need to identify an object/component with a unique id. And `is_sfparam` is a textvalue (`TYPE sfparam`) which contains a reference to the object that is transferred to the smart form. – Legxis Aug 15 '19 at 09:49
  • hello @Legxis is there any way that I could get the value to be passed in is_sfparam, whether fm or via query? – Dumbest666 Aug 15 '19 at 10:20

1 Answers1

0

This guid paramater brings no sense as it is generated in runtime. You can check this yourself by putting breakpoint at the first line (e.g. line 102) of method cl_recp_data_cn_general=>get_contract and checking id_guid var in debugger. It will be different with each run of preview in RECN tcode. Check also line 11 of CONSTRUCTOR method of CL_RECP_SF_DOC class, it is executed during each form generation.

The real contract object lays in variable go_busobj of program SAPLRECA_BDT_APPL_TOOL which brings RECN functionality and it is global i.e. it is loaded into memory constantly while RECN is running, just passing doc object into called methods thru the call stack, which you can follow in debugger.

Where really form generation takes place is CL_RECP_SF_JOB class, for preview it is _FP_PREVIEW method, for print it is _FP_PRINT. For example, in preview method form FM is called in that place

enter image description here

What you need to do if you want to call arbitrary contract print-form, which is what I assume you want to do by asking this question:

  1. Find out smartform FM name by putting breakpoint in the above line
  2. Build parameters for this FM calling. The only obligatory parameter is LS_SFPARAM-CONTENT which is the GUID.

You can generate this GUID manually by creating CL_RECP_SF_DOC object, let it be io_doc var. The constructor of this object has input parameter is_doc which should be filled according to the attributes of contract which you want to print, and which are stored in VIBDRO and VICNCN tables.

After creating this object pass its attribute io_doc->md_guid to ls_sfparam-content, generate other parameters with CL_RECP_SF_JOB->_sf_get_form_param and

  1. Run the smartform FM /1BCDWB/SF000000XX found at step 1 with these parameters

I didn't check all these steps by myself but I believe it should work.

Suncatcher
  • 10,355
  • 10
  • 52
  • 90