2017 Oct 12 3:55 PM
Hi,everyone,
I'm going to add an enhancement based on the Transaction ME51N/ME52N.
The needs has told it's going to check whether the attachment is exist when the save command is excute.
Can anyone help me!
2017 Oct 13 10:06 AM
Hi,everyone,
I've got the answer,when i change the attachmens i'll export the information list to a memory id,during command execution i'll got the list from the memory id and check whether the data exist or not.
Hi,everyone,
I'm going to add an enhancement based on the Transaction ME51N/ME52N.
The needs has told it's going to check whether the attachment is exist when the save command is excute.
Can anyone help me!
2017 Oct 13 7:44 AM
Hi,
I think you can't add an attachment in ME51N for this functionality requires a reference number, in this case, a purchase requisition number, which does not exist yet.
As for ME52N, you need to find a user-exit (that will be triggered on the save command) wherein the purchase requisition number is accessible.
Next, inside the user-exit, select data from table SRGBTBREL with the following conditions:
The code should look something like this:
data: lt_srgbtbrel type standard table of srgbtbrel.
select *
from srgbtbrel
into table lt_srgbtbrel
where reltype eq 'ATTA'
and instid_a eq us_banfn " (suppose that variable us_banfn holds the purchase requisition number)
and typeid_a eq 'BUS2105'
and catid_a eq 'BO'.
if sy-subrc ne 0.
" (means no attachment is found, display relevant error message)
endif.
2017 Oct 13 8:12 AM
Hi, Aldrin
In that case,it's wrong when i change the attachments.
For example,when i'm trying to empty the attachments,and data still exist in table srgbtbrel untill the save command ends.
2017 Oct 13 8:31 AM
Hi,
I don't get it. If you delete the attachment, the data will be definitely removed from table SRGBTBREL. As per your requirement, it should display an error if you save the document without an attachment.
2017 Oct 13 10:01 AM
Hi,
During command execution,the data of table SRGBTBREL is not the latest.For tha case, in the user-exit i cannot get the latest data.
On the other hand, If the purchase requisition had attached a attachment already,now I delete it.The attachment's information still exists in table SRGBTBREL.So it won't display any error.
2017 Oct 13 10:06 AM
Hi,everyone,
I've got the answer,when i change the attachmens i'll export the information list to a memory id,during command execution i'll got the list from the memory id and check whether the data exist or not.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |