Wednesday, May 9, 2018

VOK2 - Maintain Output Determination

vok2
      SD document
              Transport
                     Condition Type

VO10
    Text = zlog_g094_reverse_manifest

ZFP_LOG_BIL_OF_LADING_N
ZIF_LOG_BIL_OF_LADING_N

VT02N
Enter number 2025
       Go to Shipment
              Output "Printer"
                          "Screen"
             Output Type "ZMFS"

ZLOG_PICK_SLIP
ZCL_LOG_PICK_SLIP (Fetch Data)

ZCL_LOG_73070_CR52_G089_G090







SAP adobe

SFP

1) duplicate the form
2) Work only in the new copy

Tuesday, May 8, 2018

SAP Adobe Form Tutorial. Part XI. Configuring Adobe Forms in NACE, OPK8 and SPRO

SAP Adobe Form Tutorial. Part XI. Configuring Adobe Forms in NACE, OPK8 and SPRO

How to configure the Adobe Forms in SAP?

After more than 10 articles on SAP Adobe Form, we had to make room for this basic topic. Configuring Adobe Forms overlaps with the steps done in Smartforms and SAPScripts. But, still, we thought, it would be helpful, if we dedicated a short article to cover the concept here.
On a high level, we need to configure the forms in t-codes NACE, OPK8, and SPRO based on the modules you are working for.
  1. NACE

Go to Transaction code NACE. You would find the list of all the applications in SAP.
NACE configuration
Select the application area where you wanted to configure your Adobe Form and the Driver Program.
For example select V1 for Sales and press on Output types.
nace output types
Here you can find all the output types which are related to Sales.
adobe form configuration
Select the relevant output type and press on processing routines.
output type and processing routines
Go to change mode and add your Adobe Form name beside to PDF/Smartform Form. Do not forget to change the Form type to “PDF”.
to PDF/Smartform Form
Save the change.
You just completed the process of Configuring the Adobe Form in NACE Transaction. 🙂 
Also Read: System Check, Installation, and Configuration for SAP Fiori.
  1. OPK8

If you want to configure PP or PM module related forms you need to do it in the OPK8 transaction.
Go to Transaction OPK8.
PP or PM module related forms
Select one of the Output Types and press on Forms.
Output Types in SAP
Here you can Configure your Adobe Form.
Adobe Form in OPK8
Hit Save. You are done with the process of Configuring the Adobe Form in OPK8 Transaction.
Also Check: Create your first OData Service in SAP.
  1. SPRO

You can configure the QM (Quality Management) Forms in SPRO Setting. Go to transaction SPRO
  1. Press button “SAP Reference IMG”.
Navigate list as follows
  • SAP Customizing Implementation Guide
    • Quality Management
    • Quality Notifications
    • Notification Processing
    • Print control
    • Define Shop Papers, Forms, Print Programs
2. SAP Customizing Implementation Guide
Press on execute button.
Double click on Define shop papers.
SAP Reference IMG
Enter any application area.
Define shop papers
Hit Enter. You can configure under the Name of the PDF-Based From.

You just completed the SPRO Configuration of Adobe Forms for Quality Management area.
Hope you like this concise article. This article is the outcome of a question from one of your loyal readers who asked:
“Can u please explain where we will configure the driver program and associated Adobe Form name, to trigger in any transaction?”.

Now we want to hear from you.

Do you have any Question in any SAP Technical Area?
Whether you have any question or not, in either case, please leave a quick comment below and provide your feedback.

Sunday, May 6, 2018

Executing External Commands in an ABAP

Maintaining External Commands

OS Host External commands are maintained using Transaction SM69. As you can see from the screen shot below, a lot of commands are delivered by SAP in every NetWeaver system; consequently, it’s always a good idea to see if SAP has already configured the command you’re looking to execute instead of creating a new command definition from scratch.
SM69 Maintain External Commands
OK, let’s take a deeper look. In order to show you how to configure your own custom external commands, let’s look at one delivered by SAP. The PING command is available on any SAP NetWeaver AS ABAP host. The PING command will determine whether an IP address is reachable on a network.

Put your cursor on the PING command as shown above and double-click or hit the display icon.
Ping Command
As you can see in screen shot above, the definition of an external command is broken up into two distinct parts.

Fields in the COMMAND Group Box

In the Command group box, you must configure the following:
- In the Command name field, you must assign a unique name to the command. This name must be defined in the proper namespace (i.e., prefixed with a Y or Z for the customer namespace, etc.).
- The Operating System field defines the operating system or systems that support this command. In the case of the PING command, the generic ANYOS value was assigned to indicate that the PING command can be run on any host operating system. However, because some external commands are OS-specific, this field is necessary.
- The Type field refers to whether or not the command was defined by SAP or a customer.

Fields in the DEFINITION Group Box

The actual definition of the command occurs within the Definition group box. Here you define the following:
- In the Operating System Command field, define the command to be executed. This can be a built-in OS command, a path to an executable on the host system, and so on.  In our case “PING”
- In the Parameters for Operating System Command field, you can define parameters to be passed to the OS command at runtime. These parameters are static parameters that will always be passed to the command.
- If you want to allow dynamic parameters to be passed into the command, you need to select the Additional Parameters Allowed check box. These parameters are passed to the command at runtime using the API functions.
- The Trace checkbox determines whether or not you want the framework to turn on a trace when the command is being executed.
- In the Check Module input field, you can plug in a function module that is called by the framework to validate the external command before executing it. This function module must match the signature of the SXPG_DUMMY_COMMAND_CHECK function module provided with the system. This will run before the command is executed and if an exception is raised by the check module, the external command isn’t executed. This works like an EVENT or Workflow Check Function.

Testing The External Command

OK, so we want to test an SAP delivered command, or we just created a “Z” Command and we would like to test it. To test an external command, select the command and click on the Execute button in the toolbar Code Inspector

Ping Test
Here, you have the option of plugging in test parameters in the Additional Parameters field. You can also select an execution target to test the command on other application server hosts. I will use Yahoo’s site, and attempt to PING it. When you click on the Execute button, the external command is executed, and you’re navigated to the results screen shown below. Here, you can see the return code of the command, as well as the generated output.
Ping Test Results

Executing External Commands in an ABAP

To execute external commands within an ABAP program, you can use the standard function module SXPG_COMMAND_EXECUTE. To demonstrate how this works, let’s code a quick little DEMO program. This program accepts a host name as a parameter and uses it as an argument to the PING command. The PING command is executed via a call to the standard API function. The code is below.
REPORT zdemo_ping.
 CLASS lcl_command_interface DEFINITION.
   PUBLIC SECTION.
     CLASS-METHODS:
       execute_command IMPORTING im_command_name
                                   TYPE sxpgcolist-name
                                 im_param_string
                                   TYPE btcxpgpar.
 ENDCLASS.
 CLASS lcl_command_interface IMPLEMENTATION.
   METHOD execute_command.
     "Method-Local Data Declarations:
     DATAlv_status  TYPE extcmdexex-status,
           lv_retcode TYPE extcmdexex-exitcode,
           lt_output  TYPE STANDARD TABLE OF btcxpm.
     FIELD-SYMBOLS:
     <lfs_output> LIKE LINE OF lt_output.
     "Execute the selected command:
     CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
       EXPORTING
         commandname                   im_command_name
         additional_parameters         im_param_string
         operatingsystem               'ANYOS'
       IMPORTING
         status                        lv_status
         exitcode                      lv_retcode
       TABLES
         exec_protocol                 lt_output
       EXCEPTIONS
         no_permission                 1
         command_not_found             2
         parameters_too_long           3
         security_risk                 4
         wrong_check_call_interface    5
         program_start_error           6
         program_termination_error     7
         x_error                       8
         parameter_expected            9
         too_many_parameters           10
         illegal_command               11
         wrong_asynchronous_parameters 12
         cant_enq_tbtco_entry          13
         jobcount_generation_error     14
         OTHERS                        15.
     "Display the results of the command:
     LOOP AT lt_output ASSIGNING <lfs_output>.
       WRITE/ <lfs_output>-message.
     ENDLOOP.
   ENDMETHOD" METHOD execute_command
 ENDCLASS.
 PARAMETERS:
 p_host TYPE btcxpgpar LOWER CASE OBLIGATORY.
 
 START-OF-SELECTION.
   "Execute the 'PING' command:
   lcl_command_interface=>execute_command(
   im_command_name 'PING'
   im_param_string p_host ).
Let’s execute the program… You will the Selection Screen below asking for a Host Name.
Zdemo Ping Program