Académique Documents
Professionnel Documents
Culture Documents
In order to develop a ABAP Proxy first we need to have a Proxy Configured in SPROXY t Code, this is to be
done by XI person, as a ABAPer you are not concerned with this. We need to Activate this Proxy configured.
Although Proxy demands a little more code than IDoc's butu still its a better option to choose.
Author(s) Bio
In this case , proxy have 4 structured to be filled with data and then trigger the proxy to PI.
In order to create the proxy from the namespace given, we need to do following
1. Right click on the Message interface(outbound) and click on create.# After clicking on create it will ask for
Transport Request no, prefix, proxy class and other details,that we need to give in order to create the proxy and
then activate.
3. We need to create a structure that will refer to the proxy structure. We need to populate this in order to send our
data.
4. Various data declalarions required for Proxy sending and PDF attachment sending are.
g_string TYPE string, "To convert 132 character data into 255 character
data.
5. If some amount field is involved, we can use FM CONVERSION_EXIT_CUNIT_OUTPUT to put --ve sign on
the left side.# Update the main structure with the data required, if some substructures are there,then also finally
we need to fill the main structure we only, that will be passed while triggering the proxy.
g_t_header-invoice_details-invoice_line_item[] = g_t_tab_det[].
g_t_header-invoice_properties = wa_inv_pro.
6. Get all the data required for PDF into a internal table.
7. In order to send the PDF into the proxy we need to get all the data in a “Xstring” type variable.To do so first we
8. Use FM 'GET_PRINT_PARAMETERS', if some special format is required. Start the TRY-CATCH Block. To
create SPOOL :
NEW-PAGE PRINT ON
PARAMETERS g_pripar
“Write your data that need to be printed , with the format required for PDF. Whatever
g_spool_id = sy-spono.
4. Convert the Binary String to XSTRING, and concatenate it with data field, which will be sent to proxy.
$generalUtil.escapeXMLCharacters($body)
1.We need to convert this SPOOL into PDF format using FM 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
no_dialog =''
IMPORTING
pdf_bytecount = g_size_bytes
pdf_spoolid = g_pdfspoolid
btc_jobname = g_jobname
btc_jobcount = g_jobcount
TABLES
pdf = g_table " All the data will be in this Data table
CLEAR g_string.
ENDLOOP.
DO.
wa_buf = g_string.
APPEND wa_buf TO g_t_buf.
IF g_string IS INITIAL.
EXIT.
ENDIF.
ENDDO.
CONCATENATE
g_output
wa_buf
INTO g_output.
ENDLOOP.
EXPORTING
text = g_output
IMPORTING
buffer = g_outputx
5.Concatenating attach_xstring with the data field.We need to send this field to Proxy.
TRY-CATCH
TRY.
g_attachment = attch_protocol->get_attachment_from_binary(
data = g_attach_xstring
type = if_ai_attachment=>c_mimetype_pdf
EXPORTING
output = g_t_header.
COMMIT WORK.
ENDTRY.
ENDTRY.
7. Other Exception Handling can be done as per the requirement.Using the “SXMB_MONI” TCode we can