Friday, December 3, 2021

SAP SD Standard Reports

 

VA15NInquiries List
VA25NQuotations List
SDQ1Expiring Quotations
SDQ2Expired Quotations
SDQ3Completed Quotations
VA05NList of Sales Orders
SDO1Orders Within Time Period
V.02Incomplete Orders
VA35NList of Scheduling Agreements
VA45NList of Contracts
SDV1Expiring Contracts
SDV2Expired Contracts
SDV3Completed Contracts
VA14LSales Documents Blocked for Delivery
V.23Sales Documents Blocked for Billing
VL06OOutbound Delivery Monitor
VF05NList of Billing Documents
VB(8List Rebate Agreements
S_ALR_87012218Credit master sheet
F.31Credit Management Overview
FCV3Credit Management Early warning list
MCTASIS: Customer Analysis
MCTCSIS: Material Analysis
MCTESIS: Sales organization
MCTKSIS: Shipping point
MCTISIS: Sales employee
MCTGSIS: Sales office
MC(ASIS: Incoming orders
MC+ASIS: Returns
MC+ESIS: Customer Analysis: Invoiced Sales
MC+ISIS: Customer Analysis: Credit memos
F.35SIS: Credit master sheet
MC(ESIS: Material Analysis: Incoming orders
MC+MSIS: Material Analysis: Returns
MC+QSIS: Material Analysis: Invoiced Sales
MC+USIS: Material Analysis: Credit memos
MC(ISIS: Sales Orgn Analysis: Incoming orders
MC+YSIS: Sales Orgn Analysis: Returns
MC+2SIS: Sales Orgn Analysis: Sales
MC+6SIS: Sales Orgn Analysis: Credit memos
MC(MSIS: Sales Office Analysis: Incoming orders
MC-ASIS: Sales Office Analysis: Returns
MC-ESIS: Sales Office Analysis: Sales
MC-ISIS: Sales Office Analysis: Credit memos
MC(QSIS: Sales Employee Analysis: Incoming orders
MC-MSIS: Sales Employee Analysis: Returns
MC-QSIS: Sales Employee Analysis: Sales
MC-USIS: Sales Employee Analysis: Credit memos
VC/2Sales Summary (Customer Fact Sheet)
V/LDPricing Reports
VD59List Customer Material Info
VB35Promotion List
VB25List of Sales Deals
VC05List of Sales Activities
VB25List of Sales Deals
VCUSTCustomer List
VA06Sales order Monitor
SDD1Duplicate Documents

Tuesday, September 28, 2021

SAP FTP CONNECTION

 

SAP FTP CONNECTION


I am writing this blog post for the FTP connection to the SAP ABAP system. While I was configuring the SAP FTP, I haven’t found complete information in a single blog post, So I am writing this blog post.

PRE-REQUISITES:

  • FTP credentials.
  • SAP GUI credentials with authorization.
  • SAP OS access to check IP ports accessibility.
  • Network basic understanding.

STEP TO CONFIGURE FTP FOR THE SAP ABAP SYSTEM.

  • Check FTP server IP and network Port.
    • Note down the FTP IP and port provided by FTP/OS team.
    • Telnet FTP server IP on a specific port. The default port is 21.
    • Telnet Syntax (Linux & windows): telnet <IP> <PORT>
  • Check FTP is accessible from SAP system OS.
    • telnet 123.12.21.20 21


·        

    • Make sure it will connect.
    •  
  • Add FTP server entry in SAP Table.
    • Maintain FTP entry in SAP table (SAPFTP_SERVERS_V) using tcode sm30
    • SAPFTP_SERVER_V is a client dependent table. Add entry in those specific clients who are going to connect to FTP.


·        

    • Click on the Maintain button & click on the New Entries button.


·        

    • Add IP address, PORT and Description.


·        

    • After maintaining entry click on the save button.


  • Test FTP connection using SAP standard Program.
    • Execute SAP program rsftp002 using tcode SA38.


·        

    • Click on the execute button and enter details.


·        

    •  


·        

    • I am using RFC “SAPFTPA” as FTP is only accessible from the SAP server.

·        

    • If the connection is not successful you get the error like below.


·        

    • or like below.


 

 

 

·        

    • If the connection is successful you will get the output like below.


All screenshots are captured by me.

  • The above procedure will also work for the ABAP systems.
  • Telnet is a very useful tool to check the service port and its accessibility from the target.
  • SAPFTP_SERVERS_V Table is used to store the information about the allowed FTP server.
    • Without entry in this table SAP will not able to establish the connection to the FTP server.
    • If maintain * in this table all FTP servers will be accessible.
  • FTP server by default runs on port 21, If the port is different so maintain that port in SAP_FTP_SERVER_V.
  • Program RSFTP002 is used to test FTP connection and run execute FTP command.
  • There are two RFC that we can use to access FTP.
    • SAPFTP uses frontend/Local computer internet to access the FTP server.
    • SAPFTPA uses backend/SAP server internet to access the FTP server.

 

Thursday, July 15, 2021

ABAP Program for Lock All Users

 

REPORT YUSRLOCK MESSAGE-ID Z1 .


TABLES: USR02.
PARAMETERS: LOCK AS CHECKBOX, LISTLOCK AS CHECKBOX.
DATA: UFLAGVAL TYPE I, LOCKSTRING(8) TYPE C.
*————– Authorization check ———————–*
AUTHORITY-CHECK OBJECT ‘ZPROG_RUN’ ID ‘PROGRAM’ FIELD SY-CPROG.
IF SY-SUBRC <> 0.
IF SY-SUBRC = 4.
MESSAGE E000 WITH SY-CPROG. “some message about authorization check failure
ELSE.
MESSAGE E005 WITH SY-SUBRC. “some message about authorization check failure
ENDIF.
ENDIF.
IF LISTLOCK = ‘X’.
WRITE:/ ‘List all locked users: ‘.
SELECT * FROM USR02 WHERE UFLAG = 64.
WRITE: / USR02-BNAME.
ENDSELECT.
EXIT.
ENDIF.
IF LOCK = ‘X’.
UFLAGVAL = 64. “lock all users
LOCKSTRING = ‘locked’.
ELSE.
UFLAGVAL = 0. “unlock all users
LOCKSTRING = ‘unlocked’.
ENDIF.
SELECT * FROM USR02 WHERE BNAME <> ‘SAP*’ AND BNAME <> SY-UNAME.
IF USR02-UFLAG <> 0 AND USR02-UFLAG <> 64.
WRITE: ‘User’, USR02-BNAME, ‘untouched; please handle manually.’.
CONTINUE.
ENDIF.
** check that user has authority to make these changes
AUTHORITY-CHECK OBJECT ‘S_USER_GRP’
ID ‘CLASS’ FIELD USR02-CLASS
ID ‘ACTVT’ FIELD ’05’.
IF SY-SUBRC <> 0.
IF SY-SUBRC = 4.
WRITE: /’You are not authorized to lock/unlock user ‘,
USR02-BNAME, USR02-CLASS.
ELSE.
WRITE: /’Authorization error checking user ‘,
USR02-BNAME, USR02-CLASS, ‘(return code’, SY-SUBRC, ‘).’.
ENDIF.
ELSE. “has authority
UPDATE USR02 SET UFLAG = UFLAGVAL WHERE BNAME = USR02-BNAME.
WRITE: / ‘User’, USR02-BNAME, LOCKSTRING, ‘.’.
ENDIF.

ABAP program to send a report to an external mail-id




REPORT ZREPORT_TO_EMAIL NO STANDARD PAGE HEADING LINE-SIZE 200.

DATA : BEGIN OF ITAB
OCCURS 0,
PERNR LIKE PA0001-PERNR,
ENAME LIKE PA0001-ENAME,
END OF ITAB.

DATA: message_content LIKE soli OCCURS 10 WITH HEADER LINE,
receiver_list LIKE soos1 OCCURS 5 WITH HEADER LINE,
packing_list LIKE soxpl OCCURS 2 WITH HEADER LINE,
listobject LIKE abaplist OCCURS 10,
compressed_attachment LIKE soli OCCURS 100 WITH HEADER LINE,
w_object_hd_change LIKE sood1,
compressed_size LIKE sy-index.

START-OF-SELECTION.

SELECT PERNR ENAME
INTO CORRESPONDING FIELDS OF TABLE ITAB
FROM PA0001
WHERE PERNR < 50.

LOOP AT ITAB.
WRITE :/02 SY-VLINE , ITAB-PERNR, 15 SY-VLINE , ITAB-ENAME, 50
SY-VLINE.
ENDLOOP.
 

* Receivers
receiver_list-recextnam = “
EXTERNAL-MAIL-ID@GMAIL.COM”.
“–>
* EMAIL ADDRESS
RECEIVER_list-RECESC = “E”.
RECEIVER_list-SNDART = “INT”.
RECEIVER_list-SNDPRI = “1”.

APPEND receiver_list.

* General data
w_object_hd_change-objla = sy-langu.
w_object_hd_change-objnam = “Object name”.
w_object_hd_change-objsns = “P”.
* Mail subject
w_object_hd_change-objdes = “Message subject”.

* Mail body
APPEND ‘Message content’ TO message_content.

* Attachment
CALL FUNCTION ‘SAVE_LIST’
EXPORTING
list_index = ‘0’
TABLES
listobject = listobject.
CALL FUNCTION ‘TABLE_COMPRESS’
IMPORTING
compressed_size = compressed_size
TABLES
in = listobject
out
= compressed_attachment.
DESCRIBE TABLE compressed_attachment.
CLEAR packing_list.
packing_list-transf_bin = ‘X’.
packing_list-head_start = 0.
packing_list-head_num = 0.
packing_list-body_start = 1.
packing_list-body_num = sy-tfill.
packing_list-objtp = ‘ALI’.
packing_list-objnam = ‘Object name’.
packing_list-objdes = ‘Attachment description’.
packing_list-objlen = compressed_size.
APPEND packing_list.

CALL FUNCTION ‘SO_OBJECT_SEND’
EXPORTING
object_hd_change = w_object_hd_change
object_type = ‘RAW’
owner =
sy-uname
TABLES
objcont = message_content
receivers = receiver_list
packing_list = packing_list
att_cont = compressed_attachment.