Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
5,611
SAP did not provide the standard FM or program to create collection history/Resubmission/Notes in table UDM_RSM_ATTR.

It got difficult to find out standard FM or creating a program to update the records in the table.

Somehow achieved this, by writing the code.

Before going to development part, we need to understand what collection history is.

Below are the links, which can be useful to understand.

https://help.sap.com/saphelp_erp60_sp/helpdata/en/4d/c9eab5104e00b4e10000000a42189c/content.htm

https://help.sap.com/saphelp_erp60_sp/helpdata/en/27/82d65378024308e10000000a174cb4/content.htm

https://help.sap.com/saphelp_erp60_sp/helpdata/en/f9/181c54f807f47de10000000a174cb4/content.htm

 

Creation of Resubmission and Notes

Introduction:

Below is the screen shot for creation of resubmissions.

Execute Transactions UDM_SPECIALIST or UDM_SUPERVISOR.

 



Click on create button in Resubmission tab

 



Click on the display button on resubmission tab if you want to see the notes.



We need to have Customer, Invoice number and company code already present in the system which are inter linked for creating Resubmission.

 

If you have access to transaction UDM_SPECIALIST but still cannot view the customers, then either customers not present in the system or you have to get the required access from basis team.

The Records will be stored in the table UDM_RSM_ATTR and the comments section are stored in tables STXL, STXH

Collection logs will be captured only for Open Customer invoices.

Dependencies:

  1. Define Collection Profile

  2. Define Collection Groups

  3. Define Collection Segments

  4. Assign Collection Groups to Collection Segments

  5. Define Resubmission Reason and Note Reason


 

As SAP did not provide any standard FM or program, we can do it by using below logic.

Required parameter to create the record are

RSM_DATE, “Resubmission Date

RSM_GUID

CUSTOMER “ Business Partner Number

COLL_SEGMENT “ Collection Segment

RSM_REASON “ Reason for Resubmission

OBJTYPE  “Object Type

OBJKEY “Object key

 

First step: Creation of GUID.

SAP will create a unique id that can be created with below FM.

Create UID from function module that will be unique for that transaction.

*
* create guid
CALL FUNCTION 'SYSTEM_UUID_C_CREATE'
IMPORTING
uuid = lv_rsm_guid.

 

Objkey field in the table will be combination of Company code+Document no.+year+Line item.

Need to pass date in RSM_DATE field.

Pass BP to CUSTOMER field

Creation of Resubmission using Custom FM


Below is the sample logic for Custom FM to update the records in the table.

Attached source code for reference.
  DATA: l_timestamp       TYPE timestamp,
l_timestamp1 TYPE timestamp,
l_string TYPE string,
lv_string1 TYPE string,
lv_string2 TYPE string,
l_timestring(14) TYPE n,
ls_header TYPE thead,
ls_new_text TYPE itclh,
ls_rsm_attr TYPE udm_rsm_attr,
ls_rsm_attributes TYPE bdm_rsm_attr.


ls_rsm_attributes = is_rsm_attributes.
* Authority check for creation of RSM
DATA:l_error TYPE string.
AUTHORITY-CHECK OBJECT 'F_UDM_SGMT'
ID 'ACTVT' FIELD '28'
ID 'UDM_SGMNT' FIELD ls_rsm_attributes-coll_segment.

IF sy-subrc <> 0.
IF i_qualifier = c_nts.
MESSAGE e023(zudm_resubmission) INTO l_error.
ELSE.
MESSAGE e003(zudm_resubmission) INTO l_error.
ENDIF.
CALL FUNCTION 'BALW_BAPIRETURN_GET2'
EXPORTING
type = sy-msgty
cl = sy-msgid
number = sy-msgno
IMPORTING
return = return.
RETURN.
ENDIF.

* Check on resubmission date. Resubmission date can't be < today's date
IF ls_rsm_attributes-rsm_date < sy-datlo.
CALL FUNCTION 'BALW_BAPIRETURN_GET2'
EXPORTING
type = 'E'
cl = 'UDM_RESUBMISSION'
number = '004'
IMPORTING
return = return.
MESSAGE e004(zudm_resubmission).
RETURN.
ENDIF.

* Save the notes
IF NOT it_note[] IS INITIAL.
* Get the timestamp and concatenate it with the GUID of rsm to use it
* as the TDNAME for the note
GET TIME STAMP FIELD l_timestamp.
CONVERT TIME STAMP l_timestamp TIME ZONE 'UTC '
INTO DATE ls_header-tdfdate
TIME ls_header-tdftime.
UNPACK l_timestamp TO l_timestring.
CONCATENATE i_rsm_guid l_timestring INTO ls_header-tdname.
ls_header-tdid = '0001'.
ls_header-tdspras = sy-langu.
* User name is filled with the collection specialist name
ls_header-tdfuser = i_coll_specialist.
ls_header-tdobject = 'UDM_RSM'.
ls_new_text-header = ls_header.
ls_new_text-lines[] = it_note[].
ls_header-tdluser = i_coll_specialist.
ls_header-tdldate = ls_header-tdfdate.
ls_header-tdltime = ls_header-tdftime.

* Add the protocol line to the notes of the resubmission
PERFORM add_prot_line USING ls_header
CHANGING ls_new_text-lines.
* Get the protocol line into the export parameter
READ TABLE ls_new_text-lines INDEX 1 INTO es_note_prot_line.
* Save the notes
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
header = ls_new_text-header
insert = 'X'
TABLES
lines = ls_new_text-lines
EXCEPTIONS
id = 1
language = 2
name = 3
object = 4
OTHERS = 5.
IF sy-subrc <> 0.
CALL FUNCTION 'BALW_BAPIRETURN_GET2'
EXPORTING
type = sy-msgty
cl = sy-msgid
number = sy-msgno
par1 = sy-msgv1
par2 = sy-msgv2
par3 = sy-msgv3
par4 = sy-msgv4
IMPORTING
return = return.
RETURN.
ENDIF.
ENDIF.

* Prepare the structure with the attributes of RSM
GET TIME STAMP FIELD l_timestamp.

MOVE created_at to l_timestamp1.

ls_rsm_attr-rsm_guid = i_rsm_guid.
ls_rsm_attr-customer = ls_rsm_attributes-customer.
ls_rsm_attr-coll_segment = ls_rsm_attributes-coll_segment.
ls_rsm_attr-rsm_date = ls_rsm_attributes-rsm_date.
ls_rsm_attr-rsm_time = ls_rsm_attributes-rsm_time.
ls_rsm_attr-rsm_xbypass = ls_rsm_attributes-rsm_xbypass.
ls_rsm_attr-rsm_reason = ls_rsm_attributes-rsm_reason.
ls_rsm_attr-rsm_status = '0'.
ls_rsm_attr-created_by = i_coll_specialist.
* ls_rsm_attr-created_at = l_timestamp.
ls_rsm_attr-created_at = l_timestamp1. "created_at.
ls_rsm_attr-changed_by = i_coll_specialist.
ls_rsm_attr-changed_at = l_timestamp.
ls_rsm_attr-objtype = ls_rsm_attributes-objtype.
ls_rsm_attr-objkey = ls_rsm_attributes-objkey.
ls_rsm_attr-rsm_attch_count = ls_rsm_attributes-rsm_attch_count.

gs_rsm_attr = ls_rsm_attr.

CALL FUNCTION 'COMMIT_TEXT'
EXPORTING
savemode_direct = ''.

CALL FUNCTION 'UDM_RSM_CREATE_UPDATE' IN UPDATE TASK
EXPORTING
is_rsm_attr = gs_rsm_attr.


Note: On the SAP screen it does not allow to enter a back dated Resubmission. We can achieve this programmatically.

 
Labels in this area