Posts

SAP ABAP - PDF Viewer From Application Server Directory

Image
  AL11 REPORT ysap_pdf_viewer. DATA : lt_data TYPE TABLE OF x255. DATA : wa_line TYPE x255. DATA: lo_docking_container TYPE REF TO cl_gui_docking_container. DATA: lo_html    TYPE REF TO cl_gui_html_viewer. DATA: lv_url TYPE char255. DATA: ok_code(20). DATA filename TYPE string. PARAMETERS fname TYPE localfile. ** Selection screen value request AT SELECTION-SCREEN ON VALUE-REQUEST FOR fname.   CALL FUNCTION 'KD_GET_FILENAME_ON_F4'     EXPORTING       static    = 'X'     CHANGING       file_name = fname.   IF sy-subrc <> 0. * Implement suitable error handling here   ENDIF. START-OF-SELECTION.   filename = '/usr/sap/attachment/'. "AL11 Directory   filename = |{ filename }{ fname }|. * Read PDF File   PERFORM read_file. * Display to screen   PERFORM display_pdf. *&---------------------------------------------------------------------* *&      Form  r...

SAP ABAP - Upload File to OneDrive Folder

Image
  REPORT yupload_file. ** Data Declarations DATA: gv_filename    TYPE string,       lt_data_tab    TYPE TABLE OF x255,       lv_bin_size    TYPE i,       lv_file        TYPE string,       e_filenamefull TYPE string,       e_filename     TYPE string,       e_extension    TYPE string. DATA:   lv_e_pathname TYPE rstxtlg, "   lv_i_filepath TYPE rsfilenm, "   lv_e_filename TYPE rsawbnobjnm. " ** Parameters PARAMETERS : gv_name TYPE localfile. ** Selection screen value request AT SELECTION-SCREEN ON VALUE-REQUEST FOR gv_name.   CALL FUNCTION 'KD_GET_FILENAME_ON_F4'     EXPORTING       static    = 'X'     CHANGING       file_name = gv_name.   IF sy-subrc <> 0. * Implement suitable error handling here   ENDIF. START-OF-SELECTIO...

SAP ABAP - Multiple Header ALV List

REPORT ZALV_LIST_MULTIHEADER NO STANDARD PAGE HEADING. TYPE-POOLS: slis. DATA :t_fieldcat TYPE slis_t_fieldcat_alv,       w_fieldcat TYPE slis_fieldcat_alv,       layout     TYPE slis_layout_alv,       t_sort     TYPE slis_t_sortinfo_alv,       t_event    TYPE slis_t_event WITH HEADER LINE,       d_repid    LIKE sy-repid,       d_layout   TYPE slis_layout_alv,       key        TYPE slis_keyinfo_alv. TYPES : BEGIN OF ty_data,           store(50),           price      TYPE dmbtr,           quantity   TYPE p,           total      TYPE dmbtr, "(10) TYPE p DECIMALS 2,           price2     TYPE dmbtr,         ...

SAP ABAP - Display Message in Popup Table

Image
*&---------------------------------------------------------------------* *& Report YBULK_MESSAGE *&---------------------------------------------------------------------* *& *&---------------------------------------------------------------------* REPORT ybulk_message. TYPES: BEGIN OF ty_message,          msgid  LIKE sy-msgid,          msgty  LIKE sy-msgty,          msgno  LIKE sy-msgno,          msgv1  LIKE sy-msgv1,          msgv2  LIKE sy-msgv2,          msgv3  LIKE sy-msgv3,          msgv4  LIKE sy-msgv4,          lineno LIKE mesg-zeile,        END OF ty_message. DATA:   lt_message TYPE TABLE OF ty_message. START-OF-SELECTION.   PERFORM display_message. FORM display_message.   REFRESH lt_message. ...

SAP ABAP - Purchase Order Change Condition Value BADI ME_PROCESS_PO_CUST

  METHOD if_ex_me_process_po_cust~process_item.     FIELD-SYMBOLS: <ekko> TYPE ekko.     DATA: f_mepoitem TYPE mepoitem.     DATA: lt_mepoitem TYPE TABLE OF mepoitem.     DATA: fo_header TYPE REF TO if_purchase_order_mm.     DATA: f_checkheader TYPE mepoheader.     DATA: f_checkheader_curr TYPE mepoheader.     DATA: f_ekkotxt TYPE string.     TYPES : ty_komv TYPE TABLE OF komv.     DATA:       lo_services_mm TYPE REF TO if_services_mm,       gt_komv        TYPE ty_komv,       gt_komv_old    TYPE ty_komv,       zkposn         TYPE prcd_elements-kposn,       lv_amount      TYPE komv-kbetr,       lv_count       TYPE i.     FIELD-SYMBOLS:       <fs_acctv> TYPE tact-actvt,   ...

SAP ABAP - Call Transaction Code KSS2 From Custom Program

Image
DATA:   lt_mara TYPE TABLE OF mara,   ls_mara TYPE mara. DATA : xmarked TYPE char1. PARAMETERS:   p_bukrs TYPE bukrs. PARAMETERS:   p_rb1 RADIOBUTTON GROUP rb DEFAULT 'X',   p_rb2 RADIOBUTTON GROUP rb,   p_rb3 RADIOBUTTON GROUP rb,   p_rb4 RADIOBUTTON GROUP rb. START-OF-SELECTION.   CASE abap_true.     WHEN p_rb1. xmarked = 'I'.     WHEN p_rb2. xmarked = 'S'.     WHEN p_rb3. xmarked = 'V'.     WHEN p_rb4. xmarked = 'A'.   ENDCASE.   SET PARAMETER ID 'CAC' FIELD '1000'.   SET PARAMETER ID 'VPE' FIELD '001'.   SET PARAMETER ID 'GJR' FIELD sy-datum(4).   SET PARAMETER ID 'K70' FIELD xmarked. "I = Cost Center, S = Cost Center Group, V = Variant, A = All Cost Center   CALL TRANSACTION 'KSS2'.

SAP ABAP - Custom Report Stock on Posting Date

Image
  Main Program *&------------------------------------------------------------------* *& Report ZRMM008 *&------------------------------------------------------------------* *& *&------------------------------------------------------------------* REPORT zrmm008. INCLUDE zrmm008_01. INCLUDE zrmm008_02. INCLUDE zrmm008_03. INCLUDE zrmm008_04. INCLUDE zrmm008_05. START-OF-SELECTION.   "Check Company Code Authorization   AUTHORITY-CHECK OBJECT 'F_BKPF_BUK'     ID 'BUKRS' FIELD p_bukrs     ID 'ACTVT' FIELD '03'.   IF sy-subrc = 0.     IF grp1 = 'X'. *      PERFORM get_data.       PERFORM get_inv_sloc_level.     ELSE. *      PERFORM get_data_plant_level.       PERFORM get_inv_plant_level.     ENDIF.     PERFORM set_fieldcat.     PERFORM display_alv.   ELSE.     CLEAR str_msg.     str_msg = |NO Authoriz...