cancel
Showing results for 
Search instead for 
Did you mean: 

cl_rmps_general_functions=>create_dark - Document created without SRM_ID_DOCUMENT

hamza_bennekrou2
Explorer
0 Kudos

Hi experts,

We're using the function   cl_rmps_general_functions=>create_dark  to create incoming post from a local program.

When the program was run on our system ECC6 EHP6 SP04.

The incoming post was created the property SRM_DOCUMENT_ID was set according to the rule specified in the custo.  When we open the incoming post through transaction SCASEPS, we hade the document ID displayed

After the upgrade to ECC6 EHP6 SP09.

The document is created, SRM_DOCUMENT_ID is mentionned as property.  (it is set in the code, the attribute change value is recorded in the table SRMPROTOCOL). But, when we open the incoming post with transaction SCASEPS the document id is equal to [...]

Does anyone have already encountered this problem?

I already checked for sap notes, without success.

Thanks in advance for your help !

Regards

Hamza

(every valuable answer will be rewarded)


Accepted Solutions (1)

Accepted Solutions (1)

Pragya_Pande
Contributor
0 Kudos

Dear Hamza,

If attribute gets added to l_tab_props_var  then it would be set to PHIO.
If you are referring to attribute 'Incoming Post Item Indicator', I think it may not refer to SRM_DOCUMENT_ID. Try setting attribute RMPS_DOM_REFERENCE ( in addition to SRM_DOCUMENT_ID because SRM_DOCUMENT_ID is mandatory attribute so needs a value) or DESCRIPTION attribute.

Best Regards,

Pragya

hamza_bennekrou2
Explorer
0 Kudos

Dear Pragya,

I just tried in debug mode to add manually the attribute RMPS_DOM_REFERENCE, DESCRIPTION and SRM_DOCUMENT_ID  and a value.  It didn’t have any impact on my case. I still have the ”[…]” displayed in the field “Incoming Post Item Indicator”.

Note that this problem does not only appear when I call it from my program, but also when I use the standard program RMPS_POST_API_DEMO.  Which makes me think that it is a more global problem.

Anyway I think that we’re missing something.  Maybe a more detailed explication would help.

I created  a test program  ZCREATE_INC_POST, this program does nothing except calling the standard function cl_rmps_general_functions=>create_dark to create an incoming post with some predefined attributes.

Source code extract :

* Filling attributes using barcode
wa_attributs
-name  = zrmtp_attr_barcode.
wa_attributs
-value p_barcd.
APPEND wa_attributs TO attributs.

wa_attributs
-name  = zrmtp_attr_bp.
wa_attributs
-value gs_dfkkcoh-gpart.
APPEND wa_attributs TO attributs.

wa_attributs
-name  = zrmtp_attr_conref.
wa_attributs
-value gs_dfkkcoh-vtref.
APPEND wa_attributs TO attributs.

* Get document type
SELECT SINGLE inc_obj INTO g_doctype
FROM rmpspeindoctyp
WHERE  rmsid       = zrmtp_rms_id
AND   spsid       = zrmtp_incdb_sps_id.

IF sy-subrc <> 0 OR g_doctype IS INITIAL.
MESSAGE e002(zrm_msg) WITH p_canal.
ENDIF.

wa_attributs
-name  = zrmtp_attr_doctype.
wa_attributs
-value 'EMAIL'.
APPEND wa_attributs TO attributs.

wa_attributs
-name  = zrmtp_attr_canal.
wa_attributs
-value p_canal.
APPEND wa_attributs TO attributs.

wa_attributs
-name  = zrmtp_attr_company_code.
wa_attributs
-value '1000'.
APPEND wa_attributs TO attributs.

wa_attributs
-name  = zrmtp_attr_entry_date.
wa_attributs
-value sy-datum.
APPEND wa_attributs TO attributs.


* Create Incoming post
TRY.

CALL METHOD cl_rmps_general_functions=>create_dark
EXPORTING
im_rms_id       
= g_rms_id
im_sps_id       
= g_sps_id
im_tab_attributs
= attributs
im_doctype      
= g_doctype
*         im_no_path       = 'X'
IMPORTING
ex_doc_id       
= lv_doc-objid          "object-key-object_id
ex_doc_class    
= lv_doc-class       "object-key-docclass
ex_pathid       
= lv_pathid.

* HANDLE EXCEPTIONS
CATCH cx_rmps_post INTO lx_rmps_post.
lv_dummy
= lx_rmps_post->get_text( ).
CLEAR: lv_dummy.
lv_dummy
= lx_rmps_post->get_text( ).
ENDTRY.

COMMIT WORK.

In my content model I defined the attributes and the rule to be used for generating the value of the attribute SRM_DOCUMENT_ID.

DEFAULT RULES is used to set up value of SRM_DOCUMENT_ID.

Our content model ZRM03 has been generated based on the template DOMEA, using the sap standard wizard. Of course, all elements you refer to are available in our model.

If we look closer at the execution of the function we can see the following :

I’m calling the function create dark passing the right parameters and a set of attribute values

The method create_document creates a doc with the needed 2 properties.

When calling the method init_document_attributes, the l_tab_props_var does not yet contain the attribute SRM_DOCUMENT id and its value. (In the code of the method we can see that if a generic reference handler was set in parameter the reference would have been generated.  But in anycase a note added some code to generate the external reference later in the code)

After the execution of the init_document_attribute, we still don’t have the SRM_DOCUMENT_ID, but only some other attributes.

 
 

After the call to the function generate_ref_ext we can see that the reference has been field according to the rule we specified.

This reference is then set in the attribute SRM_DOCUMENT_ID and added to the table l_tab_props_var.

If we look to the created case using transaction scaseps we see that the Incoming post Indicator is not filled in.

If I use the function module RMPS_POST_GET_PROPERTIES_API to check the value of the attributes we see that the value set in the program is not present anymore and has been replaced by […]

The same behavior occurs when we create the incoming post item with the standard program RMPS_POST_API_DEMO.

Thanks a lot for your help and support !

Regards

Hamza

Pragya_Pande
Contributor
0 Kudos

Dear Hamza,

This is a new bug & note 1970506 corrects this. Currently this is under pilot release as it was awaiting validation. It will be converted to standard by end of this week.

Best Regards,

Pragya

Answers (1)

Answers (1)

Pragya_Pande
Contributor
0 Kudos

Dear Hamza,
Please check that value for SRM_DOCUMENT_ID is set to the PHIO & not to LOIO. For eg, if you are using the SRM_DOCUMENT** modules to set the attributes please see that the flag whole_document is not set to L. The attribute SRM_DOCUMENT_ID is expected to be stored in PHIO & during display, is picked up from the PHIO. If you have set the attribute value in the LOIO then you will see [...] even though the log says otherwise.

Best Regards,

Pragya

hamza_bennekrou2
Explorer
0 Kudos

Hello Pragya,

In my current version of the program, I'm not using any function module to set attributes.

I'm only using function cl_rmps_general_functions=>create_dark to create incoming post with correct attributes.  I give some attibutes to be set in parameters.  The SRM_DOCUMENT_ID has been defined in the custo to be fed from a rule.  And the standard function does the rest.

After some debug in the function cl_rmps_general_functions=>create_dark, I saw that the attribute was effectively added to the table   l_tab_props_var  etc...

But nowhere in this function I'm able to see if it is set in loio or phio.

Thanks a lot for your help  !

Regards

Hamza