Wednesday, August 6, 2025

Print Multiple Smartform from Driver Program

 REPORT ZPRIMT_MUL_SMARTFORMS.


DATA :  FM_NAME  TYPE RS38L_FNAM,
        CONTROL_PARAMETERS  TYPE  SSFCTRLOP,
        OUTPUT_OPTIONS  TYPE SSFCOMPOP,
        JOB_OUTPUT_INFO TYPE  SSFCRESCL.

types begin of tp_itab,
        name(50),
        date(8),
        amt(15),
        end of tp_itab.

data gt_itab type STANDARD TABLE OF tp_itab,
       gs_itab type tp_itab,
       gv_cnt type i,
       gv_cnt2 type i.


DATA GV_FILE  TYPE STRING,
       GV_FLAG  TYPE FLAG,
       GV_FLAG1 TYPE FLAG.



SELECTION-SCREEN begin of BLOCK b1 WITH FRAME TITLE text-001.
 PARAMETERS IP_NAME  TYPE CHAR100,
              IP_CDATE  TYPE  SYDATUM,
              IP_AMT  TYPE  PC207-BETRG.
SELECTION-SCREEN skip.
PARAMETERS P_FILE    TYPE IBIPPARMS-PATH OBLIGATORY.
SELECTION-SCREEN end of BLOCK b1.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.

*  PERFORM get_file_path CHANGING filename.
  CALL FUNCTION 'F4_FILENAME'
*    EXPORTING
*      PROGRAM_NAME  = SYST-CPROG
*      DYNPRO_NUMBER = SYST-DYNNR
*      FIELD_NAME    = ''
    IMPORTING
      FILE_NAME P_FILE.


START-OF-SELECTION.

 if P_FILE is NOT INITIAL.

   GV_FILE P_FILE.
  CLEAR GT_ITAB[].

  CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
      FILENAME                GV_FILE
      FILETYPE                'ASC'
      HAS_FIELD_SEPARATOR     'X'
*     HEADER_LENGTH           = 0
*     READ_BY_LINE            = 'X'
*     DAT_MODE                = ' '
*     CODEPAGE                = ' '
*     IGNORE_CERR             = ABAP_TRUE
*     REPLACEMENT             = '#'
*     CHECK_BOM               = ' '
*     VIRUS_SCAN_PROFILE      =
*     NO_AUTH_CHECK           = ' '
*  IMPORTING
*     FILELENGTH              =
*     HEADER                  =
    TABLES
      DATA_TAB                GT_ITAB[]
*  CHANGING
*     ISSCANPERFORMED         = ' '
    EXCEPTIONS
      FILE_OPEN_ERROR         1
      FILE_READ_ERROR         2
      NO_BATCH                3
      GUI_REFUSE_FILETRANSFER 4
      INVALID_TYPE            5
      NO_AUTHORITY            6
      UNKNOWN_ERROR           7
      BAD_DATA_FORMAT         8
      HEADER_NOT_ALLOWED      9
      SEPARATOR_NOT_ALLOWED   10
      HEADER_TOO_LONG         11
      UNKNOWN_DP_ERROR        12
      ACCESS_DENIED           13
      DP_OUT_OF_MEMORY        14
      DISK_FULL               15
      DP_TIMEOUT              16
      OTHERS                  17.
  IF SY-SUBRC <> 0.
* Implement suitable error handling here
  ENDIF.


 ENDIF.

    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
        FORMNAME                 'ZCHEQUE_PRINT1'
*       VARIANT                  = ' '
*       DIRECT_CALL              = ' '
     IMPORTING
       FM_NAME                  FM_NAME
     EXCEPTIONS
       NO_FORM                  1
       NO_FUNCTION_MODULE       2
       OTHERS                   3
              .
    IF SY-SUBRC <> 0.
* Implement suitable error handling here
    ENDIF.

    describe table gt_itab lines gv_cnt.


  IF FM_NAME IS NOT INITIAL.

    loop at gt_itab into gs_itab.

    if gv_cnt ne 1.

    gv_cnt2 sy-tabix .
    case gv_cnt2.
    when '1'.
    control_parameters-no_open   space.
    control_parameters-no_close  'X'.
    when gv_cnt .
    control_parameters-no_open   'X'.
    control_parameters-no_close  space.
    when others.
    control_parameters-no_open   'X'.
    control_parameters-no_close  'X'.
    endcase.

    endif.

    CONTROL_PARAMETERS-PREVIEW    'X'.
*    CONTROL_PARAMETERS-GETOTF    = 'X'.   "to get otf data

    CONTROL_PARAMETERS-NO_DIALOG  'X'.
    OUTPUT_OPTIONS-TDDEST         'LP01'.

    ip_name   gs_itab-NAME.
    IP_CDATE  gs_itab-DATE.
    CONDENSE gs_itab-AMT.
    IP_AMT gs_itab-AMT.

  CALL FUNCTION FM_NAME             "'/1BCDWB/SF00000259'
   EXPORTING
*     ARCHIVE_INDEX              =
*     ARCHIVE_INDEX_TAB          =
*     ARCHIVE_PARAMETERS         =
     CONTROL_PARAMETERS         CONTROL_PARAMETERS
*     MAIL_APPL_OBJ              =
*     MAIL_RECIPIENT             =
*     MAIL_SENDER                =
     OUTPUT_OPTIONS             OUTPUT_OPTIONS
     USER_SETTINGS              'X'
     IP_NAME                    IP_NAME
     IP_CDATE                   IP_CDATE
     IP_AMOUNT                  IP_AMT
*   IMPORTING
*     DOCUMENT_OUTPUT_INFO       =
*     JOB_OUTPUT_INFO            = JOB_OUTPUT_INFO
*     JOB_OUTPUT_OPTIONS         =
   EXCEPTIONS
     FORMATTING_ERROR           1
     INTERNAL_ERROR             2
     SEND_ERROR                 3
     USER_CANCELED              4
     OTHERS                     5
            .
  IF SY-SUBRC <> 0.
* Implement suitable error handling here
  ENDIF.

*   CALL FUNCTION 'HR_IT_DISPLAY_WITH_PDF'
**    EXPORTING
**      IV_PDF          =
*    TABLES
*      OTF_TABLE       = JOB_OUTPUT_INFO-OTFDATA.

    endloop.

  ENDIF.
END-OF-SELECTION.

Thursday, May 15, 2025

Overview of SAP C4C

 Overview of SAP C4C





SAP Cloud for Customer (C4C) is a cloud-based software that maintains customer sales, customer service, and marketing activities efficiently and is one of the main SAP solutions to manage customer relationships.

The target groups of SAP C4C are therefore all areas of the company that have contact points with customers essentially sales, marketing, and service.

SAP C4C is based upon the following individual products:

Ø             SAP Cloud for Sales

Ø             SAP Cloud for Marketing

Ø             SAP Cloud for Social Engagement

Features of SAP C4C:

Ø         Sales Force Automation

Ø         Marketing Automation

Ø         Customer Service and Support

Ø         Analytics and Reporting

Ø         Extended CRM Capabilities

Ø         Product Technology

SAP C4C solution can be simply integrated with SAP ERP and CRM on-premise solution. There are two ways of integration as follows:

· SAP Process Integration PI/PO − This integration is recommended when you are already utilizing process integration for on-premise systems.

· SAP HANA Cloud Integration HCI − This integration is suggested when you have to perform cloud-to-cloud integration.

Advantages of SAP C4C:

· Consume less time and money for its development — Utilizing the SAP C4C (Cloud for Customer) can save the users time as it is an integration content, executing all the hard work for its users. It contains converging all messages, mappings, and interfaces to different adapters for distinct scenarios.

· A minimal portion of configuration is all a user ever requires to identify adapters’ connection in detail, such as permitting their current landscape to sustain the integration, offering a way to essential firewalls, and organizing proxies or reverse proxies whenever needed.

· Classic SAP C/4 HANA integrations as a template — Marketers can reduce the development duration while combining a third-party system with the enterprise landscape by employing a template C/4 HANA reporting, HR, and marketing means.

· Content gets automatically updated in line with each C/4 HANA release — It is an important advantage for consultants and developers when new content gets released routinely, as it trims project timelines, thus lowering the workload.

· SAP C/4 HANA also avoid its users from retaining to rebuilding all their interfaces from scratch — This same standard integration content, SAP C4C, can efficiently be extended, if its user requires additional fields.

Summary:

SAP C4C (Cloud for Customer) outperformed the average CRM solution in nearly every module we analyzed. It particularly excelled in the extended CRM, analytics, and customer service modules with a toolkit that can benefit most organizations. It is important to keep in mind that this features and function analysis assesses the number of available features with each product over the detailed real-world application of each functionality. Any software solution’s benefits will depend on metrics that include an organization’s respective budget, limitations, and business goals.




Wednesday, June 12, 2024

Flexible workflow for purchase order

Flexible workflow allows us to define condition-based workflows for approval processes. For purchase orders, setting up automatic, one-step, or multi-step approval workflows has been made super simple. Once done, the approvers can then approve or reject the work items in the My Inbox app.

This blog is about our experience with Customization of flexible workflow for Purchase Orders, the issue we faced and the resolutions for the same. The below information can also be used as a reference for the configuration of flexible workflow for other scenarios.

Prerequisite:

  • Ensure that the automatic Customizing is active for the workflow functionality in SWU3 TCode.
  • My Inbox relevant customizing should be in place
  • Manage Workflows for Purchase order and Maintain Email template tile is available in the Fiori Launchpad

Now Let’s start with the step-by-step Journey!

  1. Open the Manage Workflow for Purchase Orders. The application is blank with the message “There are currently no scenarios available”.

  2. Go to the following the path in SPRO: SAPNETWEAVER–> Application Server –> Business Management –> SAP Business Workflow –> Flexible Workflow  –> Scenario Activation
  3. Maintain new entry for WS00800238 and set it as active



  4. If the issue on point 1 still persists assign the below authorization object:
    1. Authorization Object: S_WFFLXDEF
    2. SWFFLEXSCN -> Scenario Id (for example, WS00800157)
    3. ACTVT -> At least you will need to have authorization to display (03)
  5. This should solve the issue in point 1
  6. Click the Add button to create a new workflow for purchase orders. This will open the New workflow page

  7. Enter Workflow Name, Description, Valid From, Valid To. Enter the Start Condition for the workflow.

  8. To add the Step sequence click the add button in the Step Sequence Section. In the New Step page, Enter the Step Name and Step Type as Release of Purchase Order

  9. For Recipients Select User for Assignment By. For the user field, select a user from the Search help.
  10. If the search help return no data follow the below steps
    1. Activate HR Integration –> Goto SM30 –> Maintain table T77S0 –> search for entry group: HRALX, sem.abbr.: HRAC and set the value abbreviation value to X

    2. Go to the customizing path
      SPRO -> Cross-Application Components -> SAP Business Partner -> Business Partner -> Basic Settings -> Identification Numbers -> Define Identification Categories.
    3. unSet Identification Categories for HCM0001 for Disp. Only

    4. Check the below blog for the step by step instruction to fix this issue. Make sure to finish steps 10.i, 10.ii, 10.iii before going to the blog  employee as a business partner and synchronization with hr data   Once done the data will be visible in the search help


  11. In the Step Conditions tab, provide the relevant triggers for this specific step. We can provide as many conditions as we want, these conditions will be responsible for triggering this step
  12. No change is needed for Deadlines or Exception Handling, click the Add Button to Add the above step to the workflow.
  13. Click the Save button to save the workflow.
  14. Repeat Steps 8-9-11-12 to add additional steps to the workflow. Click the Activate Button for the workflow to be activated.

  15. Click the Define Order button to ensure that the workflow gets triggered if the Start conditions are met.

  16. Once done our workflow will appear on top.

    Significance of Order field: 
    If the start/trigger conditions of our workflow at order 1 are not met then it will check the start/trigger conditions of the workflow at order 2 (given the status is active) and so on. Now, let us test it!
  17. create a Purchase order in the Manage Purchase order application. We can see the Approval Details for the Purchase Order in the Approval Details tab.
  18. Open the My Inbox application for If the relevant task is not visible do the below steps
  19. In SPRO goto Materials Management –> Purchasing –> Purchase Order –> Flexible Workflow for Purchase Orders –> Activate Flexible workflow for Purchase Orders

  20. goto SAP Gateway Service Enablement –> Content –> Workflow Settings –> Maintain Task Names and Decision Options
    1. In the Step Name: Overview


    2. Select the above entry and click on Decision Keys and maintain the two Decision keys as below

  21. Assign Agents and Activate Event Linkages for Workflow ID WS 00800238 and TS 00800531
    1. SAP Netweaver –> Application Server –>  Business Management  –> SAP Business –>Workflow –> Perform task-specific Customizing
    2. Navigate to the SAP application component MM-PUR-PO
    3. Click Assign Agents –> select line with TS00800531 –> Click Attributes and select General Task–>clickTransfer


    4. Click Activate Event Linking–>Expand the hierarchy to display the relevant event for WS00800238 –>Activate the linkage for the listed event by clicking on the Deactivated button
    5. Once done the task will be visible in the My Inbox application, but still, there is no mail received by the recipient.
  22. Now let’s set up the Email transmission. The prerequisite to set up the Email is as below:
    1. In Transaction Code S_ATO_SETUP, set up Adaptation Transport organizer with specific data using YY1_ as prefix and sandbox prefix as YY9_.
    2. SOST and SCOT configuration should be in place
    3. Ensure Email address is maintained for the users in su01
  23. Open the Maintain Email Template application. In the pre-delivered section find the template SWF_CRT_NOTIFY_RECIPIENTS.
  24. Copy the above-mentioned template for each of the workflow scenarios. e.g. YY1_00800238_CRT_ALL for PO. This workflow template will be triggered to notify the recipients of the newly created PO, or whenever there is a PO task for approval.
  25. Copy the pre-delivered template SWF_WORKFLOW_COMPLETE_NOTIFY for each of the workflow scenarios. e.g. YY1_00800238_COMPLETE_POSITIVE for PO. These workflow templates will be triggered to notify the recipients of the completed POs, whether completed positively or negatively.

  26. Test again by creating a PO. If the mail is still not getting triggered Report RSWF_OUTPUT_MANAGEMENT needs to be executed manually with parameter productive in order to release the emails manually

With this, we conclude the configuration required for Flexible Workflow for Purchase Order including the email trigger functionality. Please do share in the comments if there are issues apart from the ones mentioned in the