Monday, November 18, 2013

XML Schema based interface Adobe form - SAP CRM

Steps:
1)Transaction:  crmc_webreq

2)Select the request categorie: ZWR

3)Request data structure:
Create, change and display fields.
Once you done with adding fields.
Save
4)Req. Cat. View:
Give the Form and Interface name
Click on Generate.

Check in SFP: Interface XML will be udated


Friday, February 15, 2013

Text value with include text on same line in SAPScripts


Using Subrotine pool we can solve the issue.

Write the code in SAPScripts
/: PERFORM TEST IN PROGRAM ZTEST_XML
/: USING &T166A-TXNAM&
/: USING &T166A-TDOBJECT&
/: USING &T166A-TDID&
/: CHANGING &DES&
/: ENDPERFORM
*              &DES&

*Create a Report
REPORT  ztest_xml.
DATA: lv_name      TYPE thead-tdname.
DATA ls_input TYPE itcsy.
DATA ls_output TYPE itcsy.
DATA : c_id     TYPE thead-tdid,
       c_object TYPE thead-tdobject,
       lt_line TYPE TABLE OF tline,
       ls_line TYPE tline.

*&---------------------------------------------------------------------*
*&      Form  TEST
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->INPUT      text
*      -->OUTPUT     text
*----------------------------------------------------------------------*
FORM test TABLES input STRUCTURE itcsy output STRUCTURE itcsy.

  READ TABLE input INTO ls_input  WITH KEY name = 'T166A-TXNAM'.
  lv_name = ls_input-value.
  READ TABLE input INTO ls_input  WITH KEY name = 'T166A-TDID'.
  c_id = ls_input-value.
  READ TABLE input INTO ls_input  WITH KEY name = 'T166A-TDOBJECT'.
  c_object = ls_input-value.

* Get long text
  CALL FUNCTION 'READ_TEXT'
    EXPORTING
      id                      = c_id
      language                = sy-langu
      name                    = lv_name
      object                  = c_object
    TABLES
      lines                   = lt_line
    EXCEPTIONS
      id                      = 1
      language                = 2
      name                    = 3
      not_found               = 4
      object                  = 5
      reference_check         = 6
      wrong_access_to_archive = 7
      OTHERS                  = 8.
  DATA lv_long_text TYPE string.
  LOOP AT lt_line INTO ls_line.
    CONCATENATE  ls_line-tdline lv_long_text INTO lv_long_text
    SEPARATED BY space.
    CLEAR ls_line.
  ENDLOOP.
  CONCATENATE 'Text you want:' lv_long_text INTO lv_long_text
  SEPARATED BY space.
  READ TABLE output INTO ls_output  WITH KEY name = 'DES'.

  IF sy-subrc = 0.
    ls_output-value = lv_long_text.
    MODIFY output FROM ls_output INDEX 1.
  ENDIF.
ENDFORM.                    "TEST

Note: Check the text length.


Saturday, January 26, 2013

Information for beginners-Experts

* RPUAUD00 all the changes made to info type. 
* ST05 Get all the select query trace.
* SE16N - &sap_edit - Change the data base entries and add new entries. (/h - fields GD-SAPEDITand GD-EDIT pass values 'X'
Or try Function Module SE16N_INTERFACE and place an X in EDIT and SAPEDIT. Often this function module still works after &SAP_EDIT has been disabled. BTW, using FM SE16n_Interface even enables you to make a cross-client select.You just have to set the parameters: I_CLNT_SPEZ,I_CLNT_DEP to 'X' and supply appropriate contents in table IT_SELFIELDS.
* Portal Level - Read-only mode. Object is currently locked by user System Administration -> Monitoring -> Object Locking. There you see all locked objects. You can select your object and unlock it.
* SAP GUI for HTML - we can custom menu bar, help etc. Article Found in SCN Click here.
* Workflow agents substitute -  RMPS_SET_SUBSTITUTE Tcode and substitute new agent.
* Debug SAPScripts - use program RSTXDBUG or SE71-  option - utilities - activate debugger.
* Debug SAP Smartforms - from SAP link click here
* GENERATE_SUBPOOL_DIR_FULL - DUMP -  SAP Note - 0000539253. (Click here for more details)
* Header/Item LongText issue in Smartform - PO - SAP note 1740705.
* Check HCM Process form Config with report - RPASR_CHECK_PROCESS
* Run Payroll - HUNCALC0 report
* Delete Payroll Results  - RPUDEL20 report
*  Create BP in ERP using “FPP1”  transaction code.    Just give   name and country and date of birth and / or date of death.
* OTR Text - get OTR text cl_wd_utilities=>get_otr_text_by_alias( 'Alias name' ). Created in sotr_edit.






Note:
I will keep on updating this, please provide any useful information through comments. So that i can place them here.

Thank you.

Thursday, December 27, 2012

Download and Upload files in Application Server


Download file from Application server
Tcode: CG3Y 

Upload files to Application Server
Tcode: CG3Z

Check files in AL11


Thursday, December 20, 2012

Dynamically make cell readonly in table web dynpro






Now assign to all the fields.

** condition for the editable or read only.
method WDDOINIT .

  DATA lo_nd_mara TYPE REF TO if_wd_context_node.
  DATA lt_mara TYPE wd_this->elements_mara.
  DATA ls_mara TYPE wd_this->element_mara.

* navigate from <CONTEXT> to <MARA> via lead selection
  lo_nd_mara = wd_context->get_child_node( name = wd_this->wdctx_mara ).

select matnr mtart mbrsh matkl meins from mara into corresponding fields of table lt_mara up to 10 rows.
  loop at lt_mara into ls_mara where matnr = '000000000000000010' or
 matnr = '000000000000000023' .
ls_mara-readonly = 'X'.
modify lt_mara from ls_mara transporting readonly where matnr = ls_mara-matnr.
  endloop.
lo_nd_mara->bind_table( new_items = lt_mara set_initial_elements = abap_true ).

endmethod.

Done!.

Do Varying with Field symbols



call function 'HR_READ_INFOTYPE'
    exporting
      tclas           = 'A'
      pernr           = iv_pernr
      infty           = '0027'
      begda           = iv_begda
      endda           = iv_endda
      bypass_buffer   = ' '
    tables
      infty_tab       = lt_p0027
    exceptions
      infty_not_found = 1
      others          = 2.


  if sy-subrc = 0.
    read table lt_p0027 into ls_p0027 index 1.
    do 12 times
          varying lv_bukrs from ls_p0027-kbu01 next ls_p0027-kbu02  "25
          varying lv_gsber from ls_p0027-kgb01 next ls_p0027-kgb02
          varying lv_kostl from ls_p0027-kst01 next ls_p0027-kst02
          varying lv_pkprz from ls_p0027-kpr01 next ls_p0027-kpr02

          varying lv_fcenter from ls_p0027-fct01 next ls_p0027-fct02 "12
          varying lv_fund from ls_p0027-fcd01 next ls_p0027-fcd02
          varying lv_farea from ls_p0027-fkber01 next ls_p0027-fkber02
          varying lv_grant from ls_p0027-grant01 next ls_p0027-grant02

          varying lv_order from ls_p0027-auf01 next ls_p0027-auf02 " order 25
          varying lv_wbs from ls_p0027-psp01 next ls_p0027-psp02 " wbs element 25

          varying lv_segment from ls_p0027-sgm01 next ls_p0027-sgm02 " SEGMENT 12
          varying lv_budget from ls_p0027-budget_pd01 next ls_p0027-budget_pd02." budget 12


      clear lv_t1018.

      ls_t1018-bukrs = lv_bukrs.
      ls_t1018-gsber = lv_gsber.
      ls_t1018-kostl = lv_kostl.
      ls_t1018-prozt = lv_pkprz.


      if ls_t1018-prozt is initial.
        exit.
      endif.


      ls_t1018-fistl = lv_fcenter.
      ls_t1018-fincode = lv_fund.
      ls_t1018-fkber = lv_farea.
      ls_t1018-grant_nbr = lv_grant.
      ls_t1018-aufnr = lv_order.
      ls_t1018-posnr = lv_wbs.
      ls_t1018-sgmnt = lv_segment.
      ls_t1018-budget_pd = lv_budget.
      append ls_t1018 to lt_t1018.
    enddo.
  endif.


********************
 code in Field Symbols : sample for 2 fields
********************
** dynamic get the field value.
  field-symbols: <fs_burks> type any,   
                 <fs_fcenter> type any.


  data lv_index(2) type n.

  data: s_burkr(5) type c value 'KBU  ', 
  data s_fcenter(5) type c value 'FCT  '.


read table lt_p0027 into ls_p0027 index 1.
do 12 times.
   lv_index = sy-index.
   s_burkr+3(2) = lv_index.
   s_fcenter+3(2) = lv_index.

   assign component s_burkr of structure ls_p0027 to <fs_burks>.
   if <fs_burks> is assigned.
     lv_bukrs = <fs_burks>.
   endif.


   assign component s_fcenter of structure ls_p0027 to <fs_fcenter>.
   if <fs_fcenter> is assigned.
     lv_fCenter = <fs_fcenter>.
   endif.


ls_t1018-bukrs = lv_bukrs.
ls_t1018-fistl = lv_fcenter.
append ls_t1018 to lt_t1018.

end do.


Friday, November 23, 2012

Drop down in Table Web Dynpro




method wddoinit .

  data lo_nd_status_drop type ref to if_wd_context_node.
 data lt_status_drop type wd_this->elements_status_drop.
 data ls_status_drop type wd_this->element_status_drop.

 ls_status_drop-status_value = 'Resubmit All'.
 append ls_status_drop to lt_status_drop.

 ls_status_drop-status_value = 'Reject All'.
 append ls_status_drop to lt_status_drop.

 ls_status_drop-status_value = 'Approve All'.
 append ls_status_drop to lt_status_drop.

 data lo_nd_approval_mng type ref to if_wd_context_node.
 data lo_element type ref to if_wd_context_element.
 data lt_approval_mng type wd_this->elements_approval_mng.
 data ls_approval_mng type wd_this->element_approval_mng.
 data lv_status_value type wd_this->element_status_drop-status_value.
 data lo_el_status_drop type ref to if_wd_context_element.
* navigate from <CONTEXT> to <APPROVAL_MNG> via lead selection
 lo_nd_approval_mng = wd_context->get_child_node( name = wd_this->wdctx_approval_mng ).
* import the details of the table
 lo_nd_approval_mng->get_static_attributes_table( importing table = lt_approval_mng ).
 loop at lt_approval_mng into ls_approval_mng. " binding the drop down
   lo_element = lo_nd_approval_mng->get_element( sy-tabix ).
   lo_nd_status_drop = lo_element->get_child_node( 'STATUS_DROP' ).
   lo_nd_status_drop->bind_table( new_items = lt_status_drop set_initial_elements = abap_true ).
 endloop.

** set your values to the drop down

 data lv_index type sytabix.
 loop at lt_approval_mng into ls_approval_mng where status is not initial.
   lv_index = sy-tabix.
   lo_element = lo_nd_approval_mng->get_element( sy-tabix ).
   lo_nd_status_drop = lo_element->get_child_node( 'STATUS_DROP' ).
   lo_el_status_drop = lo_nd_status_drop->get_element( ).
     case ls_approval_mng-status.
       when 'KEEP'.
         lv_status_value = 'Resubmit All'.
       when 'REJ'.
         lv_status_value = 'Reject All'.
       when 'APPR'.
         lv_status_value = 'Approve All'.
     endcase.
*     * set single attribute
     lo_el_status_drop->set_attribute(
       name =  `STATUS_VALUE`
       value = lv_status_value ).
     modify lt_approval_mng from ls_approval_mng index lv_index
     transporting status.
 endloop.

endmethod.


Monday, November 19, 2012

Hide the Fields in the Adobe form

Source filed, based on this we need to hide or display fields
















//Select value from list
var raw = data.resolveNode("data.#subform[0].ISR_DDL_NoSelected").rawValue;
if(raw == 11)
{
data.resolveNode("data.#subform[0].#subform[3].#field[16]").presence = "visible";
data.resolveNode("data.#subform[0].#subform[3].#field[17]").presence = "visible";
}
else
{
data.resolveNode("data.#subform[0].#subform[3].#field[16]").presence = "hidden";
data.resolveNode("data.#subform[0].#subform[3].#field[17]").presence = "hidden";
}

add code there.(in events with scripts)


Target fields


Add also add the same code in FORMREADY of source field



Useful code in Adobe forms:
read values

var value = data.resolveNode("data.#subform[0].I0962_RSREA").rawValue;
check with message box.. for the values exists or not
xfa.host.messageBox(value);


Friday, October 26, 2012

Change Selection Text in Standard Program

       



        DATA: it_tab TYPE TABLE OF rsseltexts.
        DATA: is_tab TYPE rsseltexts.
        is_tab-name = 'ZPARAMETER'. " parameter name
        is_tab-kind = 'P'.  " P/S type
        is_tab-text = 'Manager'. " Description
        APPEND is_tab TO it_tab.    

        CALL FUNCTION 'SELECTION_TEXTS_MODIFY'
          EXPORTING
            program                     = 'RCATS_DISPLAY_ACTIVITIES' " Report Name
          TABLES
            seltexts                    = it_tab
          EXCEPTIONS
            program_not_found           = 1
            program_cannot_be_generated = 2
            OTHERS                      = 3.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.

Tuesday, September 25, 2012

Function Modules for reading text descriptions


HOLIDAY_GET     Provides a table of all the holidays based upon a Factory Calendar &/ Holiday Calendar.

HR_BEN_GET_FROM_FEATURE_BAREA     Call the HR feature to determine the Benefit Area for an employee

HR_BEN_GET_FROM_FEATURE_BENGR     Call the HR feature to determine the Benefit Group for an employee

HR_BEN_GET_FROM_FEATURE_BSTAT     Call the HR feature to determine the Benefit Status for an employee

HR_BEN_GET_FROM_FEATURE_COVGR     Call the HR feature to determine the Cover Group for an employee

HR_BEN_GET_FROM_FEATURE_CSTV1     Call the HR feature to determine the CSTV1 feature for an employee

HR_BEN_GET_FROM_FEATURE_EECGR     Call the HR feature to determine the Employee Cost Group for an employee

HR_BEN_GET_FROM_FEATURE_ELIGR     Call the HR feature to determine the Eligiblity Group for an employee

HR_BEN_GET_FROM_FEATURE_ERCGR     Call the HR feature to determine the Employer Cost Group for an employee

HR_BEN_GET_FROM_FEATURE_EVTGR     Evaluate the EVTGR feature for an employee

HR_BEN_GET_FROM_FEATURE_FLXGR     Evaluate the FLXGR feature for an employee

HR_BEN_GET_FROM_FEATURE_LDAYW     Evaluate the LDAYW feature for an employee

HR_BEN_GET_FROM_FEATURE_LRPGR     Evaluate the LRPGR feature for an employee

HR_BEN_GET_FROM_FEATURE_TRMGR     Evaluate the TRMGR feature for an employee

HR_BEN_GET_FROM_FEATURE_VARGU     Evaluate the VARGU feature for an employee

HR_DISPLAY_BASIC_LIST     is an HR function, but can be used for any data. You pass it data, and column headers, and it provides a table control with the ability to manipulate the data, and send it to Word or Excel. Also see the additional documentation here.

HR_GET_LEAVE_DATA     Get all leave information (includes leave entitlement, used holidays/paid out holidays)

HR_IE_NUM_PRSI_WEEKS     Return the number of weeks between two dates.

HR_INFOTYPE_OPERATION     BAPI function module to create/change infotypes in HR
HRWPC_RFC_ABKRS_TEXT_GET      Get text description for Payroll Area

HRWPC_RFC_ANRED_TEXT_GET      Get text description for Title

HRWPC_RFC_ANSVH_TEXT_GET      Get text description for Work Contract

HRWPC_RFC_BLAND_TEXT_GET      Get text description for Tax Region

HRWPC_RFC_BTRTL_TEXT_GET      Get text description for Personnel Subarea

HRWPC_RFC_BUKRS_TEXT_GET      Get text description for Company Code

HRWPC_RFC_BVMRK_TEXT_GET      Get text description for Processing indicator

HRWPC_RFC_COMTY_TEXT_GET      Get text description for Type of control recipe destination

HRWPC_RFC_COUNC_TEXT_GET      Get text description for County Code

HRWPC_RFC_CURCY_TEXT_GET      Get text description for Currency Key

HRWPC_RFC_EVGRD_TEXT_GET      Get text description for Evaluation Group

HRWPC_RFC_FAMEI_TEXT_GET      Get text description for Family Characteristics

HRWPC_RFC_FAMST_TEXT_GET      Get text description for Marital Status Key

HRWPC_RFC_FISTL_TEXT_GET      Get text description for Funds Center

HRWPC_RFC_FREQU_TEXT_GET      Get text description for Period

HRWPC_RFC_GEBER_TEXT_GET      Get text description for Funds

HRWPC_RFC_GESCH_TEXT_GET      Get text description for Gender Key

HRWPC_RFC_GSBER_TEXT_GET      Get text description for Business Area

HRWPC_RFC_IT0XXX_TEXT_GET     Get text stored on the infotype

HRWPC_RFC_JCODE_TEXT_GET      Get text description for Survery Job

HRWPC_RFC_KOKRS_TEXT_GET      Get text description for Controlling Area

HRWPC_RFC_KONFE_TEXT_GET      Get text description for Religious Denomination Key

HRWPC_RFC_KOSTL_TEXT_GET      Get text description for Cost Center

HRWPC_RFC_LAND_TEXT_GET      Get text description for Country of company

HRWPC_RFC_MASSG_TEXT_GET      Get text description for Reason for Action

HRWPC_RFC_MASSN_TEXT_GET      Get text description for Action Type

HRWPC_RFC_MOLGA_TEXT_GET      Get text description for Country Grouping

HRWPC_RFC_NAMZ2_TEXT_GET      Get text description for Name Affix for Name at Birth

HRWPC_RFC_NAMZU_TEXT_GET      Get text description for Other Title

HRWPC_RFC_NATIO_TEXT_GET      Get text description for Nationality

HRWPC_RFC_ORGEH_TEXT_GET      Get text description for Organizational Unit

HRWPC_RFC_OTYPE_TEXT_GET      Get text description for Object Type

HRWPC_RFC_PERSG_TEXT_GET      Get text description for Employee Group

HRWPC_RFC_PERSK_TEXT_GET      Get text description for Employee Subgroup

HRWPC_RFC_PLANS_TEXT_GET      Get text description for Position

HRWPC_RFC_PLVAR_TEXT_GET      Get text description for Plan Version

HRWPC_RFC_RAILW_TEXT_GET      Get text description for Social Subscription Railway

HRWPC_RFC_SACHX_TEXT_GET      Get text description for Administrator

HRWPC_RFC_SPRSL_TEXT_GET      Get text description for Language Key

HRWPC_RFC_STATV_TEXT_GET      Get text description for Statistics indicator for pensions

HRWPC_RFC_STELL_TEXT_GET      Get text description for Job

HRWPC_RFC_STRDS_TEXT_GET      Get text description for Street Abbreviation

HRWPC_RFC_SUBTY_0XXX_TEXT_GET     Get text description for Subtype

HRWPC_RFC_SUBTY_1XXX_TEXT_GET     Get text description for Subtype

HRWPC_RFC_TITEL_TEXT_GET      Get text description for Title

HRWPC_RFC_TITL2_TEXT_GET      Get text description for Second Title

HRWPC_RFC_TMART_TEXT_GET      Get text description for Task Type

HRWPC_RFC_VDSK1_TEXT_GET      Get text description for Organizational Key

HRWPC_RFC_VORS2_TEXT_GET      Get text description for Second Name Prefix

HRWPC_RFC_VORSW_TEXT_GET      Get text description for Name Prefix

HRWPC_RFC_WERKS_TEXT_GET      Get text description for Personnel Area

INIT_TEXT     To load long text into SAP

K_WERKS_OF_BUKRS_FIND     Return a list of all plants for a given company code.

LIST_FROM_MEMORY     Retrieves the output of a report from memory when the report was executed using SUBMIT... EXPORTING LIST TO MEMORY. See also WRITE_LIST.

LIST_TO_ASCII     convert an ABAP report (displayed on screen) from OTF to ASCII format

MBEW_EXTEND     Get the stock position for the previous month. This displays the same info that you see in MM03.

MONTH_NAMES_GET     It returns all the month and names in repective language.

MONTH_PLUS_DETERMINE     Add or subtract months from a date. To subtract a month, enter a negative value for the 'months' parameter.