How to create a basic WebDynpro alv

Double-click on WD application.

 1

Enter component name on the following screen.

 2

Double-click on ‘COMPONENT CONTROLLER’ and click on ‘PROPERTIES’ tab

Click ‘Create Controller Usage’ button.

Select two components on the following screen.

 3

Create node at Component Controller Contex.

Double-Click on Interface Controller Usage.

 4

Click on ‘Controller Usage’ button on the following screen.

Drag and drop your node from Component Controller to Interface Controller.

 5

Create a ViewContainerUIElement on layout.

 6

Go to your defined Window and Create an ‘Embed View’ to your view.

 7

 8

Open your view’s WDOINIT method and write the following codes.

  datalo_node type ref to if_wd_context_node.

  datait_aoz type standard table of if_v_main=>element_aoz_table,

        is_aoz like line of it_aoz.

  select from zanil

  into corresponding fields of table it_aoz.

  lo_node wd_context->get_child_nodename ‘AOZ_TABLE’).

  lo_node->bind_tableit_aoz ).

 10

How to create ‘Condition’ step on SAP Workflow

Click on the link to learn creating a basic workflow.

Create a condition step on your workflow

1

If you don’t know to create a container element, please click here.

Click on ‘Click here to create a new condition’

Double-click on  following page at data container.

My container name is ELEMENT_TEST

2.jpg

Then click on ‘=’ and write your value in Constant input field.

Click on OKAY button or press enter.

3

4

How to create ‘Container Element’ in SAP Workflow

This post gives information about creating ‘Container Element’ in workflow and use in expressions.

Double-Click to Create Button

 1

Fill required fields like in the following screen.

 2

Click on ‘Insert Expression’ button

3.jpg

Select created container.

 4

Then expression will be like:

 5

Press F8 to execute and enter zanil container parameter as you wish.

FM to create background job

FM to create a background job:

Imports:

 

imports

Result:

result

Source Code:

FUNCTION ZTB_CREATE_JOB.

*”———————————————————————-

*”*”Local Interface:

*”  IMPORTING

*”     REFERENCE(I_JOBNAME) TYPE  STRING

*”     REFERENCE(I_REPORT) TYPE  STRING

*”     REFERENCE(I_VARIANT) TYPE  STRING OPTIONAL

*”     REFERENCE(I_UNAME) TYPE  STRING OPTIONAL

*”  EXPORTING

*”     REFERENCE(E_RETURN) TYPE  BAPIRET2

*”———————————————————————-

data:

lv_jobname  like tbtcjobjobname,

lv_report   like syrepid,

lv_variant  like raldbvariant,

lv_uname    like syuname,

lv_jobcount like tbtcjobjobcount,

lv_released type c.

lv_jobname i_jobname.

lv_report  i_report.

lv_variant i_variant.

lv_uname   i_uname.

if lv_uname is initial.

   lv_uname syuname.

endif.

* Step 1

call function ‘JOB_OPEN’

  exporting

    jobname         lv_jobname

  importing

    jobcount        lv_jobcount

 exceptions

   cant_create_job  1

   invalid_job_data 2

   jobname_missing  3

   others           4

          .

if sysubrc <> 0.

   e_returntype ‘E’.

   e_returnmessage ‘Error!’.

   exit.

endif.

* Step 2

call function ‘JOB_SUBMIT’

  exporting

    authcknam              lv_uname

    jobcount               lv_jobcount

    jobname                lv_jobname

    report                 lv_report

    variant                lv_variant

 exceptions

   bad_priparams           1

   bad_xpgflags            2

   invalid_jobdata         3

   jobname_missing         4

   job_notex               5

   job_submit_failed       6

   lock_failed             7

   program_missing         8

   prog_abap_and_extpg_set 9

   others                  10          .

if sysubrc <> 0.

   e_returntype ‘E’.

   e_returnmessage ‘Error!’.

   exit.

endif.

* Step 3

call function ‘JOB_CLOSE’

  exporting

    jobcount            lv_jobcount

    jobname             lv_jobname

    strtimmed           ‘X’

 importing

   job_was_released     lv_released

 exceptions

   cant_start_immediate 1

   invalid_startdate    2

   jobname_missing      3

   job_close_failed     4

   job_nosteps          5

   job_notex            6

   lock_failed          7

   invalid_target       8

   others               9.

if sysubrc <> 0.

   e_returntype ‘E’.

   e_returnmessage ‘Error!’.

   exit.

endif.

ENDFUNCTION.