Skip to content

Instantly share code, notes, and snippets.

View weiserman's full-sized avatar

Warren weiserman

  • Agile Business Technology
  • Cape Town
View GitHub Profile
@weiserman
weiserman / HTML Email in ABAP with Image
Created February 18, 2014 06:54
This is an example ABAP program which sends an HTML email from SAP system. It includes an image which is uploaded via transaction SMW0
*&---------------------------------------------------------------------*
*& Report YMAIL
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ymail.
@weiserman
weiserman / ABAP RTTS Example
Created January 31, 2014 06:16
Read components of a structure using ABAP RTTS
report ydemo1.
DATA: lo_sdescr TYPE REF TO cl_abap_structdescr,
ls_component TYPE abap_compdescr.
lo_sdescr ?= cl_abap_typedescr=>describe_by_name( 'LFA1' ).
LOOP AT lo_sdescr->components INTO ls_component.
WRITE: / ls_component-name.
ENDLOOP.
@weiserman
weiserman / Table RTTS example
Created January 31, 2014 06:08
ABAP RTTS for describing a table
report ydemo1.
DATA:
gv_vendor type table of lfa1.
DATA:
gs_component TYPE abap_compdescr,
go_typedescr TYPE REF TO cl_abap_typedescr,
go_strucdescr TYPE REF TO cl_abap_structdescr,
go_tabledescr TYPE REF TO cl_abap_tabledescr.
@weiserman
weiserman / FormCalc
Created January 16, 2014 08:48
Form Calc example on Adobe Interactive Form for checking address values
data.Page1.Personal_Details.Personal_Details_Fields.Original_Data1.HSNMR1[1]::preSave - (FormCalc, client)
if (STRAS1[0].rawValue <> null) then
if (ORT021[1].rawValue == null or PSTLZ1[0].rawValue == null or ORT011[0].rawValue == null or STRAS1[0].rawValue == null) then
xfa.host.messageBox("Please supply at least Street Name, District/Suburb, City and Postal Code. Full address must be supplied for changes.", "Residential Address", 3, 1)
endif
elseif (POSTA1[0].rawValue <> null) then
if (ORT021[1].rawValue == null or PSTLZ1[0].rawValue == null or ORT011[0].rawValue == null or STRAS1[0].rawValue == null) then
xfa.host.messageBox("Please supply at least Street Name, District/Suburb, City and Postal Code. Full address must be supplied for changes.", "Residential Address", 3, 1)
endif
elseif (LOCAT1[0].rawValue <> null) then
@weiserman
weiserman / gist:8451695
Created January 16, 2014 08:46
Using script on SAP Adobe Interactive to check values are populated correctly, this is entered in the "Validate" Event
var string = this.rawValue;
var pattern = /[^A-Z]/;
if (!this.isNull)
{
if (pattern.test(string))
{
xfa.host.messageBox("Please enter Initials in UpperCase having no blank spaces. Do not use any special characters, for eg: ^ - \\\ . /", "UpperCase characters."); this.rawValue = null;
}
}
@weiserman
weiserman / SAP Vendor
Created January 14, 2014 07:46
Create a vendor in SAP using the Vendor API
*&---------------------------------------------------------------------*
*& Report Creating a vendor, sample API coding
*&
*&---------------------------------------------------------------------*
*& Test for creation of vendor
*&
*&---------------------------------------------------------------------*
REPORT ydemo.
@weiserman
weiserman / ZPO_TEXTS
Created December 11, 2013 14:20
SAP Report to display long texts contained in a Purchase Order
REPORT zpo_texts.
TABLES: ekko.
TYPE-POOLS : abap, slis, rsanm, icon.
DATA: lt_ekko TYPE STANDARD TABLE OF ekko.
DATA: l_rec(5) TYPE n.
@weiserman
weiserman / BADI ME_PROCESS_PO_CUST
Last active January 4, 2021 20:56
Check Purchase Order Long Text in SAP ERP BADI. Example of implementation of BADI ME_PROCESS_PO_CUST sample code for checking long text and issuing errors.
METHOD if_ex_me_process_po_cust~check.
* Check the purchase order type and save the text
DATA: lv_tdid TYPE tdid,
lv_texttype TYPE mmpur_texttypes,
lt_text_lines TYPE mmpur_t_textlines,
lt_text_format TYPE mmpur_bool,
lv_header TYPE mepoheader,
lv_lines TYPE i.