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 - POSAP note 1740705.
* Check HCM Process form Config with reportRPASR_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 value 'KBU  '
  data s_fcenter(5) type 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.