hide button or icon in the abap report

Upload: gautam-malhotra

Post on 09-Jan-2016

109 views

Category:

Documents


1 download

DESCRIPTION

HIDE BUTTON IN ABAP

TRANSCRIPT

Hide Button or Icon in the ABAP Report

Below is the code snippet

Function : 'RS_SET_SELSCREEN_STATUS' .

FORMremove_dynamic_sel.DATA:t_excludeTYPESTANDARDTABLEOFsypfkey.APPEND'DYNS'TOt_exclude.

"DYNSisthedynamicselectionscreenfunctioncode.

CALLFUNCTION'RS_SET_SELSCREEN_STATUS'EXPORTINGp_status=sy-pfkeyTABLESp_exclude=t_exclude.ENDFORM.

Using Field Symbols

Field Symbols

1. Based on normal programming view. Field symbols will act like pointer.

2. Increased program performance.

Basic Used of Field Symbol

Dowload SAPScript Layout Code

Sometimes we need to backup or export our SAPScript code, below is the step

1. Run programRSTXSCRPthrougn SE38

2. Key in the FORM name, and click run button

3. Save the form with .txt extension, save the form in the desktop.

4. Now you have the SAPScript code in the txt mode

Changing Customer Master Data for Payment Term There are situation that you need to edit the Customer Master Data in SAP.

In this situation, we want to edit the payment term in of the customer under Company Data.

Basically before you are trying to use any BAPI that changing the data, run the BAPI that get the detail from the system. As for this I'm using BAPI_CUSTOMER_GETDETAIL1.

In this BAPI you will need to enter the appropriate data to get the detail of the Customer.

Then you will get the data of that specific customer

Based on the data that you receive follow that and fill up in the BAPI_CUSTOMER_CHANGEFROMDATA1.

IMPORTANT to change the data, you need to fill up in PI_PERSONALDATA field LASTNAME, CITY, COUNTRY, COUNTRYISO, LANGUP, LANGUP_ISO, CURRENCY, CURRENCY_ISO.

And the field that you need to change (in this case we changing Payment Term). Fill up the first PI_OPT_PERSONALDATA. In that table you just need to fill up the field that you want to change (Payment Term) and also table below it PI_OPT_PERSONALDATAX.

Then fill up the SALESORG, DIVISION, DIVISION_CHANNEL and CUSTOMER No.. Then run it.

If the return is 000, then you BAPI is execute with no error and now you can check using tcode XD03.

Have Fun...!! :)

Checking if Internal table got specific value

Reading/Checking internal table for specific value.

Below is code is best way to check whether the internal table having the value based on the key.

READTABLEmy_itemsWITHKEYmodel=im_itemTRANSPORTINGNOFIELDS.l_index=sy-tabix.IFsy-subrcNE0.RAISEfailure.ENDIF

TRANSPORTINGNOFIELDS addition make its optimize way to make the program run faster perhaps.

How to Add Customized Filed (KOB1) Actual Cost Line Items SAP Notes 325546

This guide or how to is following SAP Note 325546.

Assumption:

1. Enhancement on existing SMOD -COOMEP02. Using CI_RKPOS3. AddZZAUGBL (Clearing Document) customized field.

Steps:

1. Add the customized field in theCI_RKPOS structure.2. Data Element should follow AUGBL field from BSEG.

3. Enhance the user exitEXIT_SAPLKAEP_001 (ZXKAEPU01)4. Add line of code to read the data from table to be populated in customized field

IFi_rep_object='OR'.SELECTSINGLEaugdtaugblFROMbsegINTO(cs_record-zzaugdt,cs_record-zzaugbl)WHEREbukrs=cs_record-bukrsANDbelnr=cs_record-refbnANDgjahr=cs_record-gjahr.*buzei=

SELECTSINGLExblnrFROMbkpfINTOcs_record-zzxblnrWHEREbukrs=cs_record-bukrsANDbelnr=cs_record-refbnANDgjahr=cs_record-gjahr.ENDIF.

5. Open SM34 to edit the view table V_TKALV.

6. Choose "Field Catalog Information" and in change mode, add New Entries. For this customized field refer below figure.

Field Structure :KAEP_COACField Name: ZZAUGBLField Group: 'K' - for customized field

7. Run back the program the customized should appear in the layout selection.

------------------------------------------------How to Find Print Program ( Sapscript )

Check table T001Fand key in the program name. The Sapscript name will be at column Form

Report for doxygen documentation for ABAP sourcescreated by Markus Ulke on Dec 19, 2014 9:40 AM, last modified by Markus Ulke on Dec 19, 2014 12:52 PM Version 1 inShare Tweet The attached report generates doxygen / plant uml documentation from an abap developoment package.There are the following prerequisites:1.) you need doxygen and plantUml installed in (c:\tools\plantuml, i.e. plantuml.jar needs to be there)2.) you need a directory c:\src (this directory will be used as a workdirectory, files in this directory will be created, overwritten and deleted)4.) you need the file dp.bat in c:\tools, (you find the file in the attached as a txt file, please rename to dp.bat)5.) you need the report zmu_dump_class activated in your BW system. (BW 7.40).If you run the report, you need to provide the name of a development package and then the documentation is generated.You find the generated documentation in c:\src\html after a successfull run of zmu_dump_class.Documentation is generated by extracting class/interface/method/ddic documentation, storing them as c header files in c:\srcand then running doxygen over these files. You can include plantUML in the abap documenation and get uml diagrams included. Class diagramswill be included in any case.Please note that there is no guaranteed support its just a tool I wrote for my convenience and a tool I think it's worth sharing.

Automate Header Pricing Conditions on Sales Orderscreated by Tamara Robinson on Dec 18, 2014 3:47 PM, last modified by Tamara Robinson on Dec 23, 2014 5:48 AM Version 2 inShare Tweet Business Scenario: Automate freight header pricing condition type on sales order at the header level. Currently SAP doesn't have the capability to automate header condition types. What we mean by automate is, for example, item condition types, you can set those up with a condition record and when certain criteria is met the record is automatically inserted into the sales order. Transaction VK11/VK12/VK13 allows you to enter in the condition record type and then create/change/display records for different condition types.Solution: Put some custom code within the sales order user exit MV45AFZZ. There are several places in which custom code can be placed in order to update the sales order header condition type. One place the code can be put is the FORM userexit_save_document_prepare (which is the form that gets executed one time right before the sales document gets saved. Another place and probably the best place to put it is in the FORM userexit_pricing_prepare_tkomk. In our solution we have placed the code in the FORM userexit_pricing_prepare_tkomk. Depending on the way the environment is setup you will either have to create an enhancement or you can just update the code directly. In our example we are updating the code directly. If you need to do an enhancement or would like assistance using other FORMS feel free to ask for pointers.1. Go to SE38 and enter in MV45AFZZ and click on change. (If it asks you for an object key that means you need to create an enhancement).2. Go down to the FORM userexit_pricing_prepare_tkomk.3. In our instance we only wanted to update the header freight condition type on the creation of the sales order. In order to do this you need to start your custom code with an "if" statement that checks to make sure that t180-trtyp = 'H'. If it does, that means that it's in creation mode. The snippet of code I'm pasting is in relation to pulling information from a custom table to determine what the condition record should be and update the incoterms and payment terms along with the condition record.4. Also note in the code that there is a global variable that is set, gv_update_pricing. We had to do this in order for the new pricing to update automatically since the terms were being updated. This code needs to be placed in the FORM userexit_new_pricing_vbkd of user exit MV45AFZB. I've put the code, in order to update the pricing automatically, down below also. And again this is only done when creating the sales order.