SAP & Oracle partner and support companies

Loading

Archives June 2025

SAP

Sending Inbound IDocs from SAP Program

Prior to delving deeply into the SAP program’s inbound IDocs sending process. Typically, an external framework (let’s say XI) creates the incoming IDoc and sends it to Drain. The cycle code/relating capability module is then used to handle the incoming IDoc. In certain situations, however, due to client requirements, the connection point program should be designed so that the incoming IDoc begins within a comparable SAP framework; for instance, the sending and receiving are identical to the receive framework.

Presently for the most part in such necessities, we by and large create the IDoc subsequent to perusing information from a level record. The document is passed to the application server by a middleware (say XI). The SAP interface program peruses the record from the application server and afterward begins handling the information. To make the inbound IDoc, we want to utilize the Capability Module ‘IDOC_INBOUND_WRITE_TO_DB’. This makes and saves the IDoc to the information base. Sending Inbound IDocs from SAP Program.

PC_control_record receives the control record data for the incoming IDoc (similar to EDIDC-IDoc control record). All important information, such as status (53), shipper port, collector accomplice number, recipient port, source accomplice number, and so on, is filled in the control records. The inbound table t_data_records receives all of the IDoc data (such as EDIDD, or IDoc control record). The incoming record’s IDoc information is read, processed, and then entered into the inbound table itab_data_records_db along with the section name and other details.

Demystifying EDI IDocs: The Bridge Between Your Business and the World

The inbound cycle information is passed to the capability module.

CALL FUNCTION 'IDOC_INBOUND_WRITE_TO_DB'
exporting
pi_do_handle_error = 'X'
pi_return_data_flag = ' '
importing
pe_idoc_number = control_record_db_in-docnum
pe_inbound_process_data = wa_inbound_process_data_in
tables
t_data_records = itab_data_records_db
changing
pc_control_record = control_record_db_in
exceptions
idoc_not_saved = 1
others = 2.

Presently if the inbound IDoc has been effectively made and we need to deal with something very similar, the capability module ‘IDOC_START_INBOUND’ can be utilized. Here we pass the inbound interaction information containing the IDoc cycle code and occasion code to wa_inbound_process_data_in. The status and delivery are added to the control records inside table i_control_records.

CALL FUNCTION 'IDOC_START_INBOUND'
exporting
pi_inbound_process_data = wa_inbound_process_data_in
pi_called_online = 'X'
succ_show_flag = 'X'
tables
t_control_records = i_control_records
exceptions
others = 1.

In the event that we have no special case, the IDoc will be effectively handled and have status ’53’.

YOU MAY LIKE THIS

O Data In Sap

Best Career Option After BSc

SAP ALE IDoc Configuration Steps: Streamlining Communication

SAP

IDO file for IDocs

Don’t be confused if your heritage group, outsider group, EDI group, or non-SAP group requests a *.IDO file for an IDocs type. The SAP Idoc necessary sort’s control information and section nuances are related to the IDO document. All of the essential information needed for the non-SAP framework to plan with the SAP Idoc will be included in the IDO record.

Follow the basic advances composed beneath and send the *.IDO file for IDocs record to the requester in no time.

Steps to get *.IDO file for IDocs

Idoc fundamental sort PEXR2002 (Installment/installment counsel note/credit reminder/charge guidance) is taken for exhibit.

1. Go to exchange WE60 and key in the fundamental kind. Check the Control Record and Information Record really look at box.

2. Go to Documentation->Parser

3. Documentation for the fundamental kind is shown. This is the information which should be shipped off *.ido record

4. Presently we want to save this documentation in .ido design. Go to Framework >List->Save->Local File.5. Select unconverted radio button.

6. You will be asked for file path and file name.

7. Give the ideal way and record name, yet make a point to change the expansion from .txt to .ido. Press the Create button. This is the ido document which we are searching for. (amazed.. indeed *.ido document which the EDI/Heritage group asked is this basic record with expansion .ido)

Payment Processing through IDOCs

To get such pragmatic issues and goals directly to your inbox, if it’s not too much trouble, Buy in. We regard your security and treat safeguarding it in a serious way.

Assuming you enjoyed this post, if it’s not too much trouble, hit the offer button at the left half of your screen.

Thank you kindly for your time!!

YOU MAY BE INTERESTED IN

ALE – Error Handling Through Workflow

abap ale idoc rfc step by step

SAP Interview Questions for Freshers

SAP

A to Z of Custom Change Pointer

In this document, I have made an effort to provide the consistently expected details needed to implement custom change pointers for the custom fields in the custom tables for the custom change object and custom message type.

Configurations and Steps to implement custom change pointer:

Step 1. Make the data type of custom fields ready to record changes. (A to Z of Custom Change Pointer)

For demo, I have utilized the beneath custom table with custom fields.

The information components of the multitude of three custom fields have the Change report checked.

Step 2. Create custom message type (T-code WE81). A to Z of Custom Change Pointer
For instance I have made message type Z1P_MATMAS.

Step 3. Activate this message type to catch change pointers (T-code BD50).

Step 4. Create custom Change Document Object to link changes (T-code SCDO).

Put the custom table name (ZTEST_RS for this demo). You can add more than one tables

Step 5. Generate the custom Function Module to update changed documents (T-code SCDO).
Click Produce update pgm button.

Save it.
A new data dictionary structure called YZTEST_RS is also generated, along with an FM Z_MATMAS_WRITE_DOCUMENT to update change pointer. To trace the change pointers, the custom code would call FM Z_MATMAS_WRITE_DOCUMENT.

Step 6. Check the generated FM Z_MATMAS_WRITE_DOCUMENT.

Check the Tables area. Two tables are characterized. One is for information before change and the other is for information after change.

Kindly note: naturally the Tables in the FM are required. Assuming that you added more than one table in the exchange SCDO while creating the FM, you can make these tables as discretionary physically in SE37, so you can involve similar FM for change pointers for various tables.

Step 7. Link the change document Object, Table and Fields for the given Message Type (BD52).

Please take note that although though the field name “KEY” isn’t a field of any table, it should be provided for every table.
Except for the KEY field, the message type is directly referenced to the material expert’s fields and tables. Although it is not necessary for the specific table, this field anticipates a crucial, additional control task. A change pointer is created while creating the corresponding object in Exchange BD52 if the KEY field is identified.

Step 8. Evaluating Change Pointers (T-code BD60).
The change pointers are then assessed. It simply relies upon the article concerned what capability module is utilized here.
The capability module, MASTERIDOC_CREATE_SMD_MATMAS, which utilizations change pointers to produce IDocs is called.

Step 9. Write the custom code in the TMG event to capture changed/created data. (This is not the only way. You can write your code in other suitable areas)

Details to add event is also there in other post: http://help-sap.blogspot.com/search?q=event

In the Generate Table Maintenance screen go to Menu Environment->Modification->Events.

You will see the following screen.

Click the New Entries button and select the event you want to use and the Routine name.

Click the Manager and make your daily practice in the Incorporate program and compose the code in the daily practice to meet your prerequisite.

Sample Code to catch change pointers

FORM z_before_save.

CONSTANTS:
c_insert TYPE cdchngind VALUE ‘I’,
c_update TYPE cdchngind VALUE ‘U’,
c_check TYPE boolean VALUE ‘X’.

DATA: li_ztest_rs_old TYPE STANDARD TABLE OF ztest_rs INITIAL SIZE 0,
li_xztest_rs TYPE STANDARD TABLE OF yztest_rs INITIAL SIZE 0,
li_yztest_rs TYPE STANDARD TABLE OF yztest_rs INITIAL SIZE 0,
li_cdtext TYPE STANDARD TABLE OF cdtxt INITIAL SIZE 0,
lk_ztest_rs_x TYPE ztest_rs,
lk_ztest_rs_old TYPE ztest_rs,
lk_xztest_rs TYPE yztest_rs,
lk_yztest_rs TYPE yztest_rs,
lv_object TYPE cdobjectv.

* Sort
SORT i_ztest_rs_x[] BY zmatnr zplant.
* This will have the most recent data
DELETE ADJACENT DUPLICATES FROM i_ztest_rs_x[] COMPARING zmatnr zplant.

* Initial check
IF i_ztest_rs_x[] IS NOT INITIAL.

* Get old data
SELECT * FROM ztest_rs
INTO TABLE li_ztest_rs_old ” Old Data
FOR ALL ENTRIES IN i_ztest_rs_x
WHERE zmatnr = i_ztest_rs_x-zmatnr
AND zplant = i_ztest_rs_x-zplant.
* Looping through the current data set
LOOP AT i_ztest_rs_x INTO lk_ztest_rs_x.

* Read the old data if available
READ TABLE li_ztest_rs_old INTO lk_ztest_rs_old
WITH KEY zmatnr = lk_ztest_rs_x-zmatnr
zplant = lk_ztest_rs_x-zplant.

IF sy-subrc EQ 0.
* If found then check whether anything is changed or not
IF lk_ztest_rs_x-zmatnr NE lk_ztest_rs_old-zmatnr
OR lk_ztest_rs_x-zplant NE lk_ztest_rs_old-zplant
OR lk_ztest_rs_x-zmaktx NE lk_ztest_rs_old-zmaktx .

MOVE-CORRESPONDING lk_ztest_rs_x TO lk_xztest_rs.
* This is important
lk_xztest_rs-kz = c_update.
* Keep the new data
APPEND lk_xztest_rs TO li_xztest_rs[].

MOVE-CORRESPONDING lk_ztest_rs_old TO lk_yztest_rs.
* This is important
lk_yztest_rs-kz = c_update.
* Keep the old data
APPEND lk_yztest_rs TO li_yztest_rs[].

lv_object = lk_ztest_rs_x-zmatnr.

* Write the change pointer for changed record
CALL FUNCTION ‘Z_MATMAS_WRITE_DOCUMENT’
EXPORTING
objectid = lv_object
tcode = sy-tcode
utime = sy-uzeit
udate = sy-datum
username = sy-uname
upd_ztest_rs = c_update
TABLES
icdtxt_z_matmas = li_cdtext[]
xztest_rs = li_xztest_rs[]
yztest_rs = li_yztest_rs[].

REFRESH: li_cdtext[], li_xztest_rs[], li_yztest_rs[].
CLEAR: lv_object.
ENDIF.
* If not found, that means it is a new entry
ELSE.
MOVE-CORRESPONDING lk_ztest_rs_x TO lk_xztest_rs.
* This is important
lk_xztest_rs-kz = c_insert.
* Keep the new data
APPEND lk_xztest_rs TO li_xztest_rs[].

lv_object = lk_ztest_rs_x-zmatnr.

* Write the change pointer for new record/insert record
CALL FUNCTION ‘Z_MATMAS_WRITE_DOCUMENT’
EXPORTING
objectid = lv_object
tcode = sy-tcode
utime = sy-uzeit
udate = sy-datum
username = sy-uname
upd_ztest_rs = c_insert
TABLES
icdtxt_z_matmas = li_cdtext[]
xztest_rs = li_xztest_rs[]
yztest_rs = li_yztest_rs[].

REFRESH: li_cdtext[], li_xztest_rs[], li_yztest_rs[].
CLEAR: lv_object.
ENDIF.
ENDLOOP.
ENDIF.
ENDFORM. “z_before_save

In order to feed data in the event above, we nee to populate data (I_ZTEST_RS_X[ ]) in the custom database table screen. Write code to keep the run-time table data needed for the above logic.

The changes are logged in the standard table BDCP2. Let us check for any entry in the table for my userid and today’s date
MODULE get_new_or_changed_values INPUT.
* Keep the screen number
CONSTANTS: c_screen_0001 TYPE sydynnr VALUE ‘0001’.

* Get the data and keep in internal table to be used later
IF sy-dynnr = c_screen_0001.
APPEND ztest_rs TO i_ztest_rs_x.
ENDIF.

ENDMODULE.

You might have to pronounce a few worldwide information.
This finishes the design and custom code to get the change recognition.

Sample Output to register change pointers for Create and Change:

The progressions are signed in the standard table BDCP2. Allow us to check for any section in the table for my userid and the present date

No section is found.
Presently I will Make/Add a section in the custom table by t-code SM30 and save it.

Go to table BDCP2 and search for records. Check one passage is effectively logged.

Change a section and really look at the table for the change pointer.

Check another passage has been added.


Transactions to remember
1. SE11 to check the data type is active to record changes and to create events.
2. SE81 to create message type.
3. BD50 to activate the message type to catch change pointers.
4. SCDO to create Change Objects and generate program/function module to write change pointers.
5. BD52 to link Message Type, Change Objects, Tables and Fields.
6. BD60 to link Message Type to Standard Function Module.

Highlight recollect

In exchange BD52, field name ‘KEY’ ought to be given for each table despite the fact that it’s anything but a field of any table.

YOU MAY LIKE THIS

SAP edi idoc

What is an SAP query?

CDS in Action: Building Practical Applications

SAP

IDoc Tips—Change Pointers and Reprocessing IDocs

IDoc reprocessing in SAP IDoc: Reprocessing IDocs and Change Pointers—Valuable Exchanges

Reviewing the Fruitful IDocs again
We are unable to reprocess successful IDocs using BD87, but occasionally, particular problems may require us to resend a usually handled, successful IDoc.

BD21 – Making IDoc Types from Change Pointers (Change Pointers and Reprocessing IDocs )
At times a great deal of Progress Pointer gets made, yet neglects to get handled because of framework issues.
This t-code is very useful to create IDocs from natural change pointers. The situation with change pointer can undoubtedly be checked from BDCPV table/view.

BD22 – Erase Change Pointers (Change Pointers and Reprocessing IDocs )
In the creation climate, this one is also quite helpful. We occasionally encounter circumstances where a significant number of progress indicators are generated due to incorrect configuration or settings. This t-code is really helpful to remove them from the framework and clean up the associated data.

Additionally, you can retransmit documents from the relevant application, such as Shipment, Conveyance, and Buy Request, by going back over the Result Type if the number of documents that need to be retransmitted is limited.

Be that as it may, when we really want to send different IDocs, utilizing the standard program RC1_IDOC_SET_STATUS is very useful.

You can go to WE02 or WE09, duplicate all the handled IDoc numbers and glue them in the wake of executing this program in SE38. You would likewise have to indicate the new IDoc status.

On the off chance that you really want to handle this IDoc again utilizing BD87, you can’t straightforwardly set something very similar to 30 (IDoc prepared for dispatch), as BD87 recalls the last status (which was ’53’- Application archive posted) and consequently wouldn’t again deal with this IDoc.

Consequently we can change the status to say some transitional one like 32 – (IDoc was altered) and afterward again run this program and change the status t0 30 from 32.

How to find BADIs?

From that point forward, we can again deal with this IDocs utilizing BD87 and yet again send them to the outer framework like EDI.

YOU MAY BE INTERESTED IN

What is IDoc used for?

Just a key and two clicks for ALV consistency check

Message Processing and Transformation in SAP PO

SAP

Tool for GOS attachment from one SAP system to another SAP system

1

Another organization (let’s say XYZ, which is also in SAP) was acquired by your association (let’s say Shy, which is in SAP). The design calls for a field-tested approach that cycles from XYZ to Hesitant and stacks all the information. They must thus establish the links between XYZ business objects and related business objects in the Bashful framework. Tool for GOS attachment from one SAP system to another SAP system.

This basic instrument would transfer any connections (pdf, txt, xls, xml and so on) from source sap framework to target sap framework for all business object types.

Tool for GOS attachment from one SAP system to another SAP system

Stage 1
Plan document with Target Items (PO/PR/Merchant/Materials/Agreements and so on) and comparing Source Articles. Make a point to have comparing driving zeroes for every one of the items. Model PR would have absolute 10 characters; materials would have all out 18 characters, the seller would have complete 10 characters with driving zeroes and so on.

The following is a model record (xls) of Procurement Req from Shy and XYZ framework.

5

Step 2
Execute program Z_GOS_PREPARE_FILE in target system.

2

Step 3
Execute program Z_GOS_ATTACHMENT in target system.

3
4

Common Business Objects

Pur Req  = BUS2105      Material = BUS1001 or BUS1001006
Pur Ord  = BUS2012      Vendor  = LFA1   Contract = BUS2014  etc

Step 4
Validation for our example:

Go to ME53N for Buy Order in source Framework

6

Go to ME53N for Buy Demand in target Framework

7

ABAPer would be more inspired by the code to accomplish the above functionalities.
Kindly find the functioning code joined in four documents. If it’s not too much trouble, click the connection on the right.

Real Time Exchange Rate with Real Time Data Using Yahoo Finance API

Programs:
1) Program to prepare the input file.     z_gos_prepare_file
2) Main program for attachments.          z_gos_attachment

Function Modules:

1) RFC FM in source (XYZ) system.    z_get_xyz_gos_attachment_rfc
2) RFC FM in target (COY) system.    z_gos_attach_to_coy_rfc

Kindly note: in the Fundamental program (in PERFORM get_rfc_name), you really want to put the RFC name of your framework Being developed, Quality and Creation framework separately.

YOU MAY LIKE THIS

Unleashing the Power of Search Help Exit in SAP ABAP

Best Practices for SAP Cloud Platform Development: A Comprehensive Guide

SAP ABAP Online Training: Advanced Business Application

SAP

Sample program to attach any file from application server to any Business Object

ABAP GOS attachment from application server Let’s get started on Sample program to attach any file from the application server to any Business Object.

* Sample program to attach documents to any business object
REPORT z_gos_attachment NO STANDARD PAGE HEADING
LINE-COUNT 132.
*———————————————————————*
* SELECTION SCREEN                                                    *
*———————————————————————*
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_file   TYPE localfile,      ” Application File Path
p_objid  TYPE swo_typeid,               ” Any object like material no./vendor
“/customer/po/pr etc
p_bo     TYPE swo_objtyp.                ” Business object like LFA1 for vendor
SELECTION-SCREEN END OF BLOCK b1.
DATA:
li_content   TYPE  STANDARD TABLE OF soli,
li_objhead   TYPE STANDARD TABLE OF soli,
lwa_folmem_k TYPE sofmk,
lwa_note     TYPE borident,
lwa_object   TYPE borident,
lwa_obj_id   TYPE soodk,
lwa_content  TYPE soli,
lwa_fol_id   TYPE soodk,
lwa_obj_data TYPE sood1,
lv_ep_note   TYPE borident-objkey,
lv_lifnr     TYPE lifnr,
lv_file      TYPE string,
lv_filename  TYPE c LENGTH 100, ” file name and ext
lv_extension TYPE c LENGTH 4. ” extension only
*   Refresh data
REFRESH: li_content[], li_objhead[].

*   Open corresponding DMS files
OPEN DATASET p_file FOR INPUT IN BINARY MODE.
IF sy-subrc EQ 0.
WHILE sy-subrc = 0.
READ DATASET p_file INTO lwa_content.
* Do not put Sy-subrc eq 0 here. Please add the last line of the file,
* though sy-subrc may fail
APPEND  lwa_content TO li_content.
ENDWHILE.
* Close file
CLOSE DATASET p_file.
* In this example we are attaching in Vendor.
* Converting according to your requirement.. For example for Material,
* it should be 18 chars
* Convert Vendor
CALL FUNCTION ‘CONVERSION_EXIT_ALPHA_INPUT’
EXPORTING
input  = p_objid
IMPORTING
output = lv_lifnr.

Advance SAPUI5 – Integration of Google Maps JavaScript API with SAPUI5 App

* Convert to BIN
CALL FUNCTION ‘SO_CONVERT_CONTENTS_BIN’
EXPORTING
it_contents_bin = li_content[]
IMPORTING
et_contents_bin = li_content[].

* Get folder id
CALL FUNCTION ‘SO_FOLDER_ROOT_ID_GET’
EXPORTING
region                = ‘B’
IMPORTING
folder_id             = lwa_fol_id
EXCEPTIONS
communication_failure = 1
owner_not_exist       = 2
system_failure        = 3
x_error               = 4
OTHERS                = 5.
* Sy-subrc check not required
* Keeping file in string data type
lv_file = p_file.
* You may not need this step. But  no harm in adding this
* Get file name and extension
CALL FUNCTION ‘CH_SPLIT_FILENAME’
EXPORTING
complete_filename = lv_file
IMPORTING
extension         = lv_extension
name_with_ext     = lv_filename
EXCEPTIONS
invalid_drive     = 1
invalid_path      = 2
OTHERS            = 3.
IF sy-subrc EQ 0.
* Object header
CLEAR lwa_content.
CONCATENATE ‘&SO_FILENAME=’ lv_filename INTO lwa_content.
APPEND lwa_content TO li_objhead.
CLEAR lwa_content.
ENDIF.

lwa_object-objkey  = lv_lifnr.
* For example, business object name for PO is BUS2012,
* business object for PR is BUS2105,
* business object for Vendor is LFA1 etc
lwa_object-objtype = p_bo.
*        lwa_object-logsys  = lv_logical_system.

lwa_obj_data-objsns = ‘O’.
lwa_obj_data-objla = sy-langu.
lwa_obj_data-objdes = ‘Attachment by Raju Shrestha’.  .
lwa_obj_data-file_ext = lv_extension.

TRANSLATE lwa_obj_data-file_ext TO UPPER CASE.
* This is very important step. If your object size does not match with the input
* file size, then your object might get attached, but it will show error while you
* try to open it.
* If you have a way, where you can read the input file size directly, then assign
* it directly else, use the below formula
lwa_obj_data-objlen =  lines( li_content ) * 255.

* Insert data
CALL FUNCTION ‘SO_OBJECT_INSERT’
EXPORTING
folder_id                  = lwa_fol_id
object_type                = ‘EXT’
object_hd_change           = lwa_obj_data
IMPORTING
object_id                  = lwa_obj_id
TABLES
objhead                    = li_objhead
objcont                    = li_content
EXCEPTIONS
active_user_not_exist      = 1
communication_failure      = 2
component_not_available    = 3
dl_name_exist              = 4
folder_not_exist           = 5
folder_no_authorization    = 6
object_type_not_exist      = 7
operation_no_authorization = 8
owner_not_exist            = 9
parameter_error            = 10
substitute_not_active      = 11
substitute_not_defined     = 12
system_failure             = 13
x_error                    = 14
OTHERS                     = 15.
IF sy-subrc = 0 AND lwa_object-objkey IS NOT INITIAL.
lwa_folmem_k-foltp = lwa_fol_id-objtp.
lwa_folmem_k-folyr = lwa_fol_id-objyr.
lwa_folmem_k-folno = lwa_fol_id-objno.

* Please note: lwa_fol_id and lwa_obj_id are different work areas

lwa_folmem_k-doctp = lwa_obj_id-objtp.
lwa_folmem_k-docyr = lwa_obj_id-objyr.
lwa_folmem_k-docno = lwa_obj_id-objno.

lv_ep_note = lwa_folmem_k.
lwa_note-objtype = ‘MESSAGE’.
*          lwa_note-logsys    = lv_logical_system.
lwa_note-objkey = lv_ep_note.

* Link it
CALL FUNCTION ‘BINARY_RELATION_CREATE_COMMIT’
EXPORTING
obj_rolea      = lwa_object
obj_roleb      = lwa_note
relationtype   = ‘ATTA’
EXCEPTIONS
no_model       = 1
internal_error = 2
unknown        = 3
OTHERS         = 4.
IF sy-subrc EQ 0.
* Commit it
COMMIT WORK.
WRITE:/ ‘Attached successfully’.
ENDIF.
ELSE.
MESSAGE ‘Error while opening file’ TYPE ‘I’.
LEAVE LIST-PROCESSING.
ENDIF.
ENDIF.

YOU MAY LIKE THIS

Steampunk Chronicles: Navigating the Cloud with SAP BTP ABAP Environment

Tips for Building Custom SAP Applications: A Comprehensive Guide

SAP ABAP on HANA Interview Questions: Mastering the Essentials

SAP

Table to check whether a business object has any GOS attachment or not

How can I determine if a business object has a GOS attachment? We would really like to know how many GOS connections are there in Buy Requests, Buy Demands, Merchants, and so on. Using the GOS relationship table “SRGBTBREL” is the simplest way to locate this.

Proceed to SE16(N) and provide the name of the business object in the TYPEID_A (Kind of Articles) box. For example, if the business object name is BUS2012 for the PO, BUS2105, LFA1 for the Seller, 1001006 for the Material, and so on, you can click Execute to view the rundown or click Number of Passages to view the number of connections in that business object. How can I determine if a business object has a GOS attachment?

Selective Handling of the Buttons in ALV Grid Toolbar

You can get the rundown of business object in exchange SWO1.

On the off chance that for reasons unknown, you can’t sort out the business object in exchange SWO1, then the most straightforward method for finding the business object is by going to the exchange (say MM02, ME22N or XK02 and so on) for the article you are intrigued and connect one archive and save it. Presently take that article number and go to table SRGBTBREL and enter the material/po/merchant and so on in field INSTID_A with all driving zeroes. You will get the business object name in field TYPEID_A.

YOU MAY LIKE THIS

SAP ABAP on HANA

How to find badi in sap abap ?

Fiori App – An Introduction from an ABAPer

SAP

SAP Cloud Platform Integration (CPI) Part 23 – Step-by-Step Guide to Mail Adapter Configuration with Attachments

1. Overview on Mail Adapter

Prior to proceeding with SAP Cloud Platform Integration (CPI) Part 23: Detailed Instructions for Configuring Mail Adapters with Attachments. Let’s quickly go over the Mail Adapter. An extensive set of tools and capabilities for coordinating various frameworks and applications inside an organization is provided by SAP CPI (SAP Cloud Stage Mix). The Mail Connector, which enables regular integration with email features and facilitates the sharing of data and relationships, is one of SAP CPI’s key features.

The SAP CPI Mail Connector serves as a bridge between the joining stage and email frameworks like as Gmail, Microsoft Trade, or another SMTP/POP3-compatible mail server. As part of scenarios involving reconciliation, it provides the ability to send and receive messages along with their connections.

Here are a few critical viewpoints and capacities of the SAP CPI Mail Connector: SAP Cloud Platform Integration (CPI) Part 23 – Step-by-Step Guide to Mail Adapter Configuration with Attachments

Configuration:

The Mail Connector can be effortlessly arranged inside SAP CPI utilizing the online incorporation stream proofreader. Directors can characterize settings, for example, mail server subtleties, confirmation certifications, email designs (e.g., plain text or HTML), and connection taking care of choices.

Email Sending:

With the Mail Connector, SAP CPI can send messages from combination streams to outer beneficiaries or interior post boxes. It upholds different email credits like source, recipient(s), subject, body, and need. Connections can likewise be incorporated by indicating the record area or giving the document content straightforwardly inside the combination stream.

Email Receiving:

The Mail Connector permits SAP CPI to get approaching messages and cycle their items. It upholds the recovery of email credits like source, recipient(s), subject, body, and connections. Joining streams can be set off in view of the appearance of new messages, empowering robotization and reconciliation with different frameworks.

Attachment Handling:

The Mail Connector works with the treatment of email connections inside SAP CPI. Connections can be removed from approaching messages and handled by the incorporation stream’s prerequisites. They can be saved to nearby registries, changed, or sent to different frameworks on a case by case basis.

Error Handling and Monitoring:

SAP CPI gives vigorous mistake taking care of and checking abilities for the Mail Connector. It permits executives to follow the situation with email handling, screen approaching and active messages, and handle special cases or disappointments during incorporation streams including the Mail Connector.

2. IFlow Setup

The SAP CPI Mail Connector doesn’t uphold demand answer usefulness essentially in light of the nonconcurrent idea of email correspondence.

While utilizing the Mail Connector, the correspondence between the joining stream in SAP CPI and the email server follows a nonconcurrent design. The combination stream can set off the sending of an email or tune in for approaching messages, however it doesn’t keep an immediate, simultaneous association with the email server.

Subsequently, use SEND range capability for email situations.

As to mail connector properties:

Address – SMTP mail address

Intermediary type – In the event that its through cloud connector, notice on-premise or, in all likelihood Web.

Area ID – of cloud connector

Assurance – Off/STARTTLS Required/STARTTLS Discretionary

Validation – None/Plain Username Secret word/Encoded Username Secret key

Under the handling tab,

From – Email From

To – Email To

Cc/Bcc

Subject – Mail subject. Here we can specify dynamic properties/header which can stream at runtime as displayed beneath.

Mail Body – We can pass the approaching payload as mail body like underneath or design a mail body according to prerequisite.

Body-Emulate type – The substance sort of the body segment. In the event that its Text/HTML, assuming there are any html components, it would be changed over. To send all things considered, pick Message/Plain. There are numerous different choices moreover. Go ahead and investigate.

Body Encoding – UTF-8

For Mail connections,

SAP has given 2 choices. We can make a connection by passing the header content or the body content.

We can find in the underneath picture, where we are passing the stacktrace header (which we set in past satisfied modifier step, ${exception.stacktrace}). Notice the name of the connection too.

Add Message connections – Assuming there are any connections sent by the shipper and the equivalent must be communicated to the recipient, then, at that point, this choice ought to be empowered.

Content exchange Encoding – Programmed

Overall Setup:

Mail:

By along these lines, we can design the mail connector and use it in IFlow. Gratitude for perusing this blog. Blissful learning!

YOU MAY BE INTERESTED IN

10 Real-World SAP ABAP Programming Examples (with Code!)

SAP ABAP vs SAP Basis

Top SAP ABAP Interview Questions (2024)

SAP

How to Send Custom Purchase Order Form Directly to the Vendor?

Let’s look at some concrete methods on how to send a custom purchase order form straight to the vendor. This is the cycle stream to achieve the equivalent.

1. Make a Result Type for the Buy Request with ‘Outer Send’ medium in ME22N

2. Select the Result Type and go to Additional Information.
Select either ‘Send with application own exchange’ to have the choice to audit the report prior to sending or select ‘Send Quickly’ to send email straightforwardly on Save.

3. To save the result type and start the email, click Save.
Assuming you choose “Send with application own exchange,” to initiate the email, navigate to ME9F – > Open the record – > Select the PO and snap Result Message.


Assuming you picked ‘Send Right away’, email would set off upon save. Go to SOST to see email set off.

Detailed Steps :

1. Go to NACE transaction to create a custom output type and assign your PO form and its program in ‘Processing Routine’

2. Add outer send as ‘Medium’, your zprogram’s name in ‘Program’, a subroutine in your zprogram in ‘Program’s Structure Schedule’, your PO structure’s name in ‘PDF/Smartform Structure’ and pdf in ‘Type’

or then again you can utilize Standard PO structure in light of your necessity or need.

3. Make a custom program to set off PO structure and join it to an email to the seller.
The rationale is to set off PO structure’s FM and get the PO structure information from the FM’s Bringing in boundaries, convert it to a paired table and add it as connection to the email. See the code underneath

You can also read for:- Easy Trick to Disable Hold Button in PO (ME21N) using BADI

REPORT zprogram.

INCLUDE rvadtabl. "standardinclude, needed for getting objky from me22n
DATA: gv_fm_name TYPE rs38l_fnam, " FM Name
       gs_fp_docparams TYPE sfpdocparams,
       gs_fp_outputparams TYPE sfpoutputparams.
Data: gv_purdoc_no type ekko-ebeln,
      gv_ldest     type char4.
CONSTANTS : gv_form_name TYPE fpname VALUE 'YOUR CUSTOM FORM NAME',
            gc_printprev type string VALUE 'PREVOUTPUT'.

FORM zsubroutine USING uv_retco LIKE sy-subrc "return code
                           uv_screen TYPE c.
  PERFORM display CHANGING uv_retco. "if output successfull, need to change return code from 999.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form display
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*&      <-- ENT_RETCO
*&---------------------------------------------------------------------*
FORM display  CHANGING cv_retco TYPE sy-subrc.

  IF sy-ucomm = gc_printprev."'PREVOUTPUT'
    gs_fp_outputparams-nodialog = ''.
    gs_fp_outputparams-preview  = abap_true.
  ELSE.
    gs_fp_outputparams-nodialog = abap_true.
    gs_fp_outputparams-preview  = ''.
    gs_fp_outputparams-reqnew   = abap_true.
    gs_fp_outputparams-getpdf   = abap_true.
    IF nast-dimme = abap_true. 
      gs_fp_outputparams-reqimm   = abap_true.
    ENDIF.
  ENDIF.

  DATA: lo_send_request TYPE REF TO cl_bcs VALUE IS INITIAL.
  DATA: lt_message_body TYPE bcsy_text VALUE IS INITIAL,
        lo_document     TYPE REF TO cl_document_bcs VALUE IS INITIAL.
  DATA: lx_document_bcs TYPE REF TO cx_document_bcs VALUE IS INITIAL.
  DATA: lo_sender TYPE REF TO if_sender_bcs VALUE IS INITIAL.
  DATA: lo_recipient TYPE REF TO if_recipient_bcs VALUE IS INITIAL.
  DATA: lv_sent_to_all(1) TYPE c VALUE IS INITIAL,
        lw_return         TYPE bapiret2.

  DATA: lw_formoutput TYPE fpformoutput,
        lt_binarytab  TYPE solix_tab,
        lv_sub        TYPE so_obj_des,
        lv_in_update TYPE i.

  CALL FUNCTION 'FP_JOB_OPEN'
    CHANGING
      ie_outputparams = gs_fp_outputparams
    EXCEPTIONS
      cancel          = 
      usage_error     = 2
      system_error    = 3
      internal_error  = 4
      OTHERS          = 5.
  IF sy-subrc <> 0.

    CALL FUNCTION 'NAST_PROTOCOL_UPDATE'
      EXPORTING
        msg_arbgb = sy-msgid
        msg_nr    = sy-msgno
        msg_ty    = sy-msgty
        msg_v1    = sy-msgv1
        msg_v2    = sy-msgv2
        msg_v3    = sy-msgv3
        msg_v4    = sy-msgv4
      EXCEPTIONS
        OTHERS    = 0.

  ENDIF.
**
  TRY.
      CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
        EXPORTING
          i_name     = gv_form_name 
        IMPORTING
          e_funcname = gv_fm_name.
      "Exception handling
    CATCH cx_fp_api_internal.
    CATCH cx_fp_api_repository.
    CATCH cx_fp_api_usage.
  ENDTRY.

  cv_retco = 0.

  gv_purdoc_no = nast-objky. "objky contains purchase doc number

  CALL FUNCTION gv_fm_name 
    EXPORTING
      iv_purdoc_no       = gv_purdoc_no
    IMPORTING
      /1bcdwb/formoutput = lw_formoutput
    EXCEPTIONS
      usage_error        = 1
      system_error       = 2
      internal_error     = 3
      OTHERS             = 4.

  IF sy-subrc = 0.

    CALL FUNCTION 'NAST_PROTOCOL_UPDATE'
      EXPORTING
        msg_arbgb = 'ZSCM'
        msg_nr    = '022'
        msg_ty    = 'S'
*       MSG_V1    = TEXT-001
      EXCEPTIONS
        OTHERS    = 0.
  ELSE.

    CALL FUNCTION 'NAST_PROTOCOL_UPDATE'
      EXPORTING
        msg_arbgb = sy-msgid
        msg_nr    = sy-msgno
        msg_ty    = sy-msgty
        msg_v1    = sy-msgv1
        msg_v2    = sy-msgv2
        msg_v3    = sy-msgv3
        msg_v4    = sy-msgv4
      EXCEPTIONS
        OTHERS    = 0.

  ENDIF.

  CALL FUNCTION 'FP_JOB_CLOSE'
    EXCEPTIONS
      usage_error    = 1
      system_error   = 2
      internal_error = 3
      OTHERS         = 4.
  IF sy-subrc <> 0.
*   Implement suitable error handling here
  ENDIF.

"Convert Form Output to Binary table to be added as email attachment
  CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
    EXPORTING
      buffer     = lw_formoutput-pdf
*     APPEND_TO_TABLE       = ' '
*   IMPORTING
*     OUTPUT_LENGTH         =
    TABLES
      binary_tab = lt_binarytab.

  SELECT SINGLE ekko~ebeln, ekpo~ebelp, ekko~lifnr, ekpo~werks, ekko~bedat FROM ekko
    INNER JOIN ekpo
    ON ekko~ebeln = ekpo~ebeln
    INTO @DATA(lw_povendor)
    WHERE ekko~ebeln = @gv_purdoc_no
      AND ekpo~loekz = ''.

  IF sy-subrc = 0.

    "Here you can create a Custom Table to maintain email data for each Vendor. I am fetching Email To, Email Cc, Email From and Subject Line that is maintained for that PO's vendor

    SELECT SINGLE * FROM zvendoremaildatatable INTO @DATA(lw_vendordetails)
      WHERE lifnr = @lw_povendor-lifnr.
    IF sy-subrc = 0.

      lv_sub = lw_vendordetails-zsubject.
      "You can edit the subject line with PO data dynamically       data(lv_bedat_formatted) = |{ lw_povendor-bedat+4(2) }| && |/| && |{ lw_povendor-bedat+6(2) }|.
      REPLACE FIRST OCCURRENCE OF 'mmdd' IN lv_sub WITH lv_bedat_formatted. "lw_povendor-bedat
      REPLACE FIRST OCCURRENCE OF '&&' IN lv_sub WITH gv_purdoc_no.

      lo_send_request = cl_bcs=>create_persistent( ).

      "Add email body  APPEND 'Thanks,' TO lt_message_body.
       APPEND 'Bhavya Kariwala' TO lt_message_body.

      lo_document = cl_document_bcs=>create_document(
                                      i_type = 'RAW'
                                      i_text = lt_message_body
                                      i_subject = lv_sub ).
      DATA(lv_attachment_name) = |PO#| && |{ gv_purdoc_no }| && | Form|.
      TRY.

          lo_document->add_attachment(
                        EXPORTING
                          i_attachment_type = 'pdf'
                          i_attachment_subject = CONV sood-objdes( lv_attachment_name )
*                   I_ATTACHMENT_SIZE =
*                   I_ATTACHMENT_LANGUAGE = SPACE
*                   I_ATT_CONTENT_TEXT =
*                   I_ATTACHMENT_HEADER =
                          i_att_content_hex = lt_binarytab ).

        CATCH cx_document_bcs INTO lx_document_bcs.

      ENDTRY.

      lo_send_request->set_document( lo_document ).

      "Set sender
      lo_sender = cl_sapuser_bcs=>create( sy-uname ).
      lo_sender = cl_cam_address_bcs=>create_internet_address( CONV adr6-smtp_addr(  lw_vendordetails-zemail_from ) ).

      lo_send_request->set_sender(
                        EXPORTING
                          i_sender = lo_sender ).

      "Set recipient
"I have maintained multiple email addresses for a vendor separated by ';', so it's now been put into an internal table to be looped through.
      SPLIT lw_vendordetails-zemail_to AT ';' INTO TABLE DATA(lt_emailto).
      SPLIT lw_vendordetails-zemail_cc AT ';' INTO TABLE DATA(lt_emailcc).

      LOOP AT lt_emailto INTO DATA(lw_emailto).
*        TRY.
          lo_recipient = cl_cam_address_bcs=>create_internet_address( CONV adr6-smtp_addr( lw_emailto ) ).
          lo_send_request->add_recipient(
                            EXPORTING
                              i_recipient  = lo_recipient                 " Recipient of Message
                            i_express    = abap_true                 " Send As Express Message
*                        i_copy       =                  " Send Copy
*                        i_blind_copy =                  " Send As Blind Copy
*                        i_no_forward =                  " No Forwarding
                          ).
*        CATCH cx_send_req_bcs. " BCS: Send Request Exceptions
*        ENDTRY.
      ENDLOOP.

      LOOP AT lt_emailcc INTO DATA(lw_emailcc).
*        TRY.
            lo_recipient = cl_cam_address_bcs=>create_internet_address( CONV adr6-smtp_addr( lw_emailcc ) ).
            lo_send_request->add_recipient(
                              EXPORTING
                                i_recipient  = lo_recipient                 " Recipient of Message
                              i_express    =  abap_true                " Send As Express Message
                                i_copy       = abap_true                  " Send Copy
*                    i_blind_copy =                  " Send As Blind Copy
*                    i_no_forward =                  " No Forwarding
                            ).
*        CATCH cx_send_req_bcs. " BCS: Send Request Exceptions
*        ENDTRY.
      ENDLOOP.

      "Send email
      lo_send_request->send(
                        EXPORTING
                          i_with_error_screen = 'X'
                        RECEIVING
                          result = lv_sent_to_all ).
"Check to see if email was triggered in UPDATE TASK
      CALL FUNCTION 'TH_IN_UPDATE_TASK'
       IMPORTING
         IN_UPDATE_TASK       = lv_in_update
                .
      IF lv_in_update <> 1.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          EXPORTING
            wait   = abap_true
          IMPORTING
            return = lw_return.
      endif.

    ENDIF.
  ENDIF.
ENDFORM.

4. Furthermore, as consumed in the code above, you can make a table to keep up with Email Information for every Merchant. You can make a Table Upkeep Generator to keep up with sections against every Seller so this interaction can turn out to be more robotized.

Hope you got the How to Send Custom Purchase Order Form Directly to the Vendor?

thanks! have a good day.

YOU MAY LIKE THIS

Is SAP ABAP a High Paying Job?

SAP ABAP Consultant Trainer

Your Definitive Guide to Becoming a SAP ABAP Developer

SAP

Object Oriented Way of Sending an email with PDF as an Attachment

Introduction

Send an email in Apex that includes a PDF attachment (Object Oriented Method of Sending an Email with a PDF Attachment)

The blog post I wrote on the topic of “Item Arranged approach to sending an email from ABAP side” is expanded upon in this one. An object-oriented method for attaching a PDF to an email.

You will also learn how to send an email using an object-oriented method with a PDF attached in this blog post, Object Oriented Way of Sending an Email with PDF as an Attachment. In this case, a SMARTFORM will generate the PDF.

Prerequisite (Object Oriented Way of Sending an email with PDF as an Attachment)

  1. A Smartform – It tends to be an essential smartform with a short message, we simply need it for show reason.
  2. Essential information on involving class CL_BCS for email sending.
  3. A trigger program.

Steps

Create a Smartform with any Z/Y name.

I made with the name “ZTEST_SMARTFORM_ATTACHMENT”. It simply have a short text as beneath:

Create an executable program in SE38.

I made it with the name “ZTEST_EMAIL_WITH_ATTACHMENT”.

DATA DECLARATIONS

(Please excuse for the naming convention used)

CONSTANTS:
lc_sfname TYPE tdsfname VALUE 'ZTEST_SMARTFORM_ATTACHMENT'. "Name of Smartform

"Local Object References
DATA: lo_bcs         TYPE REF TO cl_bcs,
      lo_doc_bcs     TYPE REF TO cl_document_bcs,
      lo_recep       TYPE REF TO if_recipient_bcs,
      lo_sapuser_bcs TYPE REF TO cl_sapuser_bcs,
      lo_cx_bcx      TYPE REF TO cx_bcs.

"Local Internal Tables.
DATA: lt_otfdata        TYPE ssfcrescl,
      lt_binary_content TYPE solix_tab,
      lt_text           TYPE bcsy_text,
      lt_pdf_tab TYPE STANDARD TABLE OF tline,
      lt_otf     TYPE STANDARD TABLE OF itcoo.

"Local Structures
DATA: ls_ctrlop TYPE ssfctrlop,
      ls_outopt TYPE ssfcompop.

"Local Variables
DATA: lv_bin_filesize TYPE so_obj_len,
      lv_sent_to_all  TYPE os_boolean,
      lv_bin_xstr     TYPE xstring,
      lv_fname        TYPE rs38l_fnam,
      lv_string_text  TYPE string.

Get the name of the function module of the SMARTFORM .

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
  EXPORTING
    formname           = lc_sfname
  IMPORTING
    fm_name            = lv_fname
  EXCEPTIONS
    no_form            = 1
    no_function_module = 2
    OTHERS             = 3.
IF sy-subrc <> 0.
  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.

Fill the Control Parameters, output options and call the FM of your SMARTFORM.

We will get the OTF data generated by the smartform in internal table “lt_otf”.

"Control Parameters
ls_ctrlop-getotf    = 'X'.
ls_ctrlop-no_dialog = 'X'.
ls_ctrlop-preview   = space.

"Output Options
ls_outopt-tdnoprev  = 'X'.
ls_outopt-tddest    = 'LOCL'.
ls_outopt-tdnoprint = 'X'.    "No printing from print preview

CALL FUNCTION lv_fname
  EXPORTING
    control_parameters = ls_ctrlop
    output_options     = ls_outopt
  IMPORTING
    job_output_info    = lt_otfdata
  EXCEPTIONS
    formatting_error   = 1
    internal_error     = 2
    send_error         = 3
    user_canceled      = 4
    OTHERS             = 5.
IF sy-subrc <> 0.
  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.


lt_otf[] = lt_otfdata-otfdata[].

Convert OTF Data to XSTRING “lv_bin_xstr”.

CALL FUNCTION 'CONVERT_OTF'
  EXPORTING
    format                = 'PDF'   "PDF to get pdf output
  IMPORTING
    bin_filesize          = lv_bin_filesize
    bin_file              = lv_bin_xstr
  TABLES
    otf                   = lt_otf[]
    lines                 = lt_pdf_tab[]
  EXCEPTIONS
    err_max_linewidth     = 1
    err_format            = 2
    err_conv_not_possible = 3
    OTHERS                = 4.
IF sy-subrc <> 0.
  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.

Convert the XSTRING to Binary table “lt_binary_content”.

***Xstring to binary
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
  EXPORTING
    buffer     = lv_bin_xstr
  TABLES
    binary_tab = lt_binary_content.

Prepare to Send Email

 Create persistent send request

TRY.
*     -------- create persistent send request ------------------------
    lo_bcs = cl_bcs=>create_persistent( ).

Create Email Body

    "Line-1
    CONCATENATE 'Dear Colleague' cl_abap_char_utilities=>newline INTO lv_string_text.
    APPEND lv_string_text TO lt_text.
    CLEAR lv_string_text.
    "Line-2
    CONCATENATE 'Please find attached a test smartform.'
     cl_abap_char_utilities=>newline INTO lv_string_text.
    APPEND lv_string_text TO lt_text.
    CLEAR lv_string_text.
    "Line-3
    APPEND 'Best Regards,' TO lt_text.
    "Line-4
    APPEND 'Systems Administrator.' TO lt_text.

Create Email

*---------------------------------------------------------------------
*-----------------&      Create Document     *------------------------
*---------------------------------------------------------------------
    lo_doc_bcs = cl_document_bcs=>create_document(
                    i_type    = 'RAW'
                    i_text    = lt_text[]
                    i_length  = '12'
                    i_subject = 'Test Email' ).   "Subject of the Email

Add attachment to document and Add document to send request

The interior table “lt_binary_content” contains the substance of our connection.

*---------------------------------------------------------------------
*-----------------&   Add attachment to document     *----------------
*---------------------------------------------------------------------
*     BCS expects document content here e.g. from document upload
*     binary_content = ...
    CALL METHOD lo_doc_bcs->add_attachment
      EXPORTING
        i_attachment_type    = 'PDF'
        i_attachment_size    = lv_bin_filesize
        i_attachment_subject = 'Test Email'
        i_att_content_hex    = lt_binary_content.

*     add document to send request
    CALL METHOD lo_bcs->set_document( lo_doc_bcs ).

you can also read for:- AI Tools for Email marketing

Set Sender

Note: this is fundamental provided that you need to set the source unique in relation to genuine client (SY-UNAME). In any case source is set consequently with genuine client.
FYI. I have remarked the code in my program.

*---------------------------------------------------------------------
*------------------------&   Set Sender     *-------------------------
*---------------------------------------------------------------------
*    lo_sapuser_bcs = cl_sapuser_bcs=>create( sy-uname ).
*    CALL METHOD lo_bcs->set_sender
*      EXPORTING
*        i_sender = lo_sapuser_bcs.

Add recipient (e–mail address)

You can involve various beneficiaries too.

    lo_recep = cl_cam_address_bcs=>create_internet_address(
                                                'test@test123.com' ).

"Add recipient with its respective attributes to send request
    CALL METHOD lo_bcs->add_recipient
      EXPORTING
        i_recipient = lo_recep
        i_express   = 'X'.

Set Send Immediately

You can set this to promptly send your email.

CALL METHOD lo_bcs->set_send_immediately
      EXPORTING
        i_send_immediately = 'X'.

Send the Email

*---------------------------------------------------------------------
*-----------------&   Send the email    *-----------------------------
*---------------------------------------------------------------------
    CALL METHOD lo_bcs->send(
      EXPORTING
        i_with_error_screen = 'X'
      RECEIVING
        result              = lv_sent_to_all ).

    IF lv_sent_to_all IS NOT INITIAL.
      COMMIT WORK.
    ENDIF.


*---------------------------------------------------------------------
*-----------------&   Exception Handling     *------------------------
*---------------------------------------------------------------------
  CATCH cx_bcs INTO lo_cx_bcx.
    "Appropriate Exception Handling
    WRITE: 'Exception:', lo_cx_bcx->error_type.
ENDTRY.

Conclusion

This is one of the approach to sending an email with a PDF connection.

For any issues, enhancements, augmentations or some other worries, kindly go ahead and get in touch with us.

I look forward for your criticism and ideas.

Continue to learn!! Continue to get to the next level!!

YOU MAY LIKE THIS

Epic Evolution of ABAP Programming

Mastering the Basics of SAP ABAP: A Comprehensive Guide

How to check your custom ABAP code for SAP BTP ABAP Environment

× How can I help you?