Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

what is the wrong in the program?

Former Member
0 Likes
551

hi all,

i am new to abap.after giving the input values it is showing an error make an entry in all field where required..... what is the mistake in code? plz help

FUNCTION ZFMCREATECUSTOM.

*"----------------------------------------------------------------------

*"*"Local Interface:

*"  IMPORTING

*"     VALUE(TITLE_P) TYPE  ZBAPICREATECUSTOM-TITLE_P

*"     VALUE(FIRSTNAME) TYPE  ZBAPICREATECUSTOM-FIRSTNAME

*"     VALUE(SECONDNAME) TYPE  ZBAPICREATECUSTOM-SECONDNAME

*"     VALUE(CITY) TYPE  ZBAPICREATECUSTOM-CITY

*"     VALUE(DISTRICT) TYPE  ZBAPICREATECUSTOM-DISTRICT

*"     VALUE(POSTL_COD1) TYPE  ZBAPICREATECUSTOM-POSTL_COD1

*"     VALUE(COUNTRY) TYPE  ZBAPICREATECUSTOM-COUNTRY

*"     VALUE(REGION) TYPE  ZBAPICREATECUSTOM-REGION

*"     VALUE(LANGU_P) TYPE  ZBAPICREATECUSTOM-LANGU_P

*"     VALUE(LANGU_ISO) TYPE  ZBAPICREATECUSTOM-LANGU_ISO

*"     VALUE(CURRENCY_ISO) TYPE  ZBAPICREATECUSTOM-CURRENCY_ISO

*"     VALUE(REF_CUSTMR) TYPE  ZBAPICREATECUSTOM-REF_CUSTMR

*"  EXPORTING

*"     VALUE(CUSTOMERNO) TYPE  BAPIKNA103-CUSTOMER

*"     VALUE(RETURN) TYPE  BAPIRETURN1

*"----------------------------------------------------------------------

  DATA WA_RETURN TYPE BAPIRETURN1.

  DATA:

        PERSONALDATA    LIKE BAPIKNA101_1,

         COPYREF        LIKE BAPIKNA102,

         CUSTNUMBER(10) TYPE C.


  CALL FUNCTION 'BAPI_CUSTOMER_CREATEFROMDATA1'

    EXPORTING

      PI_PERSONALDATA              = PERSONALDATA

*   PI_OPT_PERSONALDATA          =

*   PI_COMPANYDATA               =

*   PI_OPT_COMPANYDATA           =

*   PI_CONSUMEREN                =

      PI_COPYREFERENCE             = COPYREF

*   PI_CREDIT_CONTROL_FLAG       =

   IMPORTING

   CUSTOMERNO                   = CUSTOMERNO

      RETURN                       = WA_RETURN

            .

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

  IF NOT WA_RETURN IS INITIAL.

    WRITE : / WA_RETURN-MESSAGE.

    RETURN = WA_RETURN.

  ENDIF.

ENDFUNCTION.

Moderator message : Not enough re-search before posting, discussion locked.

Message was edited by: Vinod Kumar

2 REPLIES 2
Read only

Former Member
0 Likes
520

Hi Navya,

In your function module in Import parameter tab , Near to Default value column one more column called optional will be there.

If you don check that check box for particular field , It will become mandatory. so if don enter any value for that in the runtime when giving input it will thro error. so if want to make it optional check that check box. so if you don give input for that particular field it won give you error.

Same way in Export parameters tab also.

Regards,

Ramya Ramasamy

Read only

0 Likes
520

i given all input values.... ok i will show my input values...