Monday, November 14, 2011

HR_GET_EMPLOYEES_FROM_USER

"mark---------------------
DATA : ee_tab TYPE PERNR_US_TAB,
wa_ee_tab type line of PERNR_US_TAB.
* get pernr, molga, ename
CALL FUNCTION 'HR_GET_EMPLOYEES_FROM_USER'
EXPORTING
user = sy-uname
TABLES
ee_tab = ee_tab.
LOOP AT ee_tab into wa_ee_tab.
ENDLOOP.

PNPPERNR-SIGN = 'I'.
PNPPERNR-OPTION = 'EQ'.
PNPPERNR-LOW = wa_ee_tab-pernr.
APPEND PNPPERNR.

How to use a table with no header

DATA : ee_tab TYPE PERNR_US_TAB,
wa_ee_tab type line of PERNR_US_TAB.
* get pernr, molga, ename
CALL FUNCTION 'HR_GET_EMPLOYEES_FROM_USER'
EXPORTING
user = sy-uname
TABLES
ee_tab = ee_tab.

LOOP AT ee_tab into wa_ee_tab.

ENDLOOP.

Sunday, November 13, 2011

How to hide certain fields or button in your selection screen

*&---------------------------------------------------------------------*
*& Report Y_MARK
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT Y_MARK.


DATA: D_UCOMM LIKE SY-UCOMM.

PARAMETERS: P_GRPA1(10) MODIF ID A,
P_GRPA2(5) MODIF ID A,
P_GRPB1(2) MODIF ID B.

PARAMETERS: P_ACTA RADIOBUTTON GROUP RAD1 USER-COMMAND ACT DEFAULT 'X',
P_ACTB RADIOBUTTON GROUP RAD1.

AT SELECTION-SCREEN.
D_UCOMM = SY-UCOMM.

AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF P_ACTA = 'X'.
IF SCREEN-GROUP1 = 'B'.
SCREEN-ACTIVE = 0.
ENDIF.
ELSEIF P_ACTB = 'X'.
IF SCREEN-GROUP1 = 'A'.
SCREEN-ACTIVE = 0.
ENDIF.
ENDIF.
MODIFY SCREEN.
ENDLOOP.

START-OF-SELECTION.

Tuesday, November 8, 2011

The maintenance dialog for zXXXXX is incomplete or not defined

This is how you create maintenance dialog for ztable.

Use tcode SE11, enter the table name click change. In the next screen, click Utitlies-->table maintenance generator.

Enter &NC& as the auth group.
Enter the function group to use (ex. Z_TABMAINT)

click One Step, enter '1' as the screen number. Click the create button.

Once generated, you can use it by going to SM30, enter table name and click maintain.

Source
http://forums.sdn.sap.com/thread.jspa?threadID=1087759

IAC - how to create

IAC iview is used when you want to create an iview of an ITS service. In the thrid step of creating IAC iview we should pass the ITS service name for IAC property.
Steps to create IAC iview.
1. Create a system object for R/3 with ITS property category also.
2. create a Service in transaction using SICF. The below thread will help you.

https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2204
3. create an an iview and give the service name in IAC textbox not R/3 System name.

Also check:
https://www.sdn.sap.com/irj/sdn/thread?threadID=243082

http://help.sap.com/saphelp_nw04/helpdata/en/44/216fe21784648ee10000000a1553f7/frameset.htm

M again mentioning all the steps for IAC iview creation, plz check.

Steps to display the SAP Transaction as Internet Application Component (IAC) in Portal
The following three tasks have to be performed step by step:
1.Creating the IAC
2.Activating the IAC
3.Creating an IAC iview in the portal

Creating an IAC
1)Go to transaction sicf. Click on the "watch"button. Under Virtual Host / Services expand Default_host > SAP > bc > gui > sap > ITS. Now right click over ITS and select New Sub-Element.
2)In the new dialog box give the name of the service.
3)Now write a description in the description box. In the drop box corresponding to GUI Link select the option Yes. Now click the GUI Transaction button and enter the parameters as shown below.
Parameter Name Value
~TRANSACTION sm36
~THEME 99
~generateDynpro 1
~noHeaderOkCode 1
4)Now go to the tab Handler List and maintain the parameter CL_HTTP_EXT_ITS.
Now click on the save button from the top and save it.
You can now see the service under ITS.

Activating the service

After saving the IAC, we need to activate the service. Select the service under ITS, right click over it and select Activate Service. The service will get activated.

Creating an IAC iview in the portal

We need to create an iview which in tern will use a system to connect to the ITS.
In the WAS property of the system maintain the following property
Web As Host Name :
Web As Path /sap/bc/gui/sap/its/
Web As Protocol HTTP/HTTPS
Under Content Administration > Portal Content create an iview of type SAP IAC iview and specify the system alias name and the IAC.

source
http://forums.sdn.sap.com/thread.jspa?threadID=841234

Monday, November 7, 2011

HR reporting - defaulting value through programming

Ever wanted to put a default value into the HR reporting....

Now you can.

1. Run the program and press F1 to the defaulted field you want to initialise.

2. Under the abap coding "INITIALIZATION" copy the code below please modify base on your field name.

INITIALIZATION. "TO ADD IF THERE IS ANY TO INITIALIZE
PNPSTAT2-SIGN = 'I'.
PNPSTAT2-OPTION = 'EQ'.
PNPSTAT2-LOW = '0'. PNPSTAT2-HIGH = '0'. APPEND PNPSTAT2.

3. Activate and run the program! Walla Done...

Tuesday, November 1, 2011

SAP Remove Comma / Remove full stop




**********************************************************************

* FORM    :   remove_comma

* Created :  13.09.2011 18:33:22

**********************************************************************

FORM REMOVE_COMMA CHANGING $FIELD.



  DATA : WA_INDEX(02) TYPE I.

  DATA : F3(10) TYPE C.



  F3 = $FIELD.



  DO 10 TIMES.

    IF F3+WA_INDEX(01) EQ ','.

      F3+WA_INDEX(01) = ''.

    ENDIF.

    ADD TO WA_INDEX.

  ENDDO.



  CONDENSE F3 NO-GAPS.

  $FIELD = F3.



ENDFORM. " remove_comma



**********************************************************************


* FORM    :   remove_fullstop

* Created :  13.09.2011 18:33:22

**********************************************************************

FORM REMOVE_FULLSTOP CHANGING $FIELD.



  DATA : WA_INDEX(02) TYPE I.

  DATA : F3(10) TYPE C.



  F3 = $FIELD.



  DO 10 TIMES.

    IF F3+WA_INDEX(01) EQ '.'.

      F3+WA_INDEX(01) = ''.

    ENDIF.

    ADD TO WA_INDEX.

  ENDDO.



  CONDENSE F3 NO-GAPS.

  $FIELD = F3.



ENDFORM. " remove_fullstop